资源简介
能运行的JavaWeb项目,其中包括源码和数据库,适合初学JavaWeb的同学作为参考资料

代码片段和文件信息
package com.action;
import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.dao.DB;
import com.orm.TAdmin;
public class admin_servlet extends HttpServlet
{
public void service(HttpServletRequest reqHttpServletResponse res)throws ServletException IOException
{
String type=req.getParameter(“type“);
if(type.endsWith(“adminMana“))
{
adminMana(req res);
}
if(type.endsWith(“adminAdd“))
{
adminAdd(req res);
}
if(type.endsWith(“adminDel“))
{
adminDel(req res);
}
}
public void adminMana(HttpServletRequest reqHttpServletResponse res) throws ServletException IOException
{
List adminList=new ArrayList();
String sql=“select * from t_admin“;
object[] params={};
DB mydb=new DB();
try
{
mydb.doPstm(sql params);
ResultSet rs=mydb.getRs();
while(rs.next())
{
TAdmin admin=new TAdmin();
admin.setUserId(rs.getInt(“userId“));
admin.setUserName(rs.getString(“userName“));
admin.setUserPw(rs.getString(“userPw“));
adminList.add(admin);
}
rs.close();
}
catch(Exception e)
{
e.printStackTrace();
}
mydb.closed();
req.setAttribute(“adminList“ adminList);
req.getRequestDispatcher(“admin/admin/adminMana.jsp“).forward(req res);
}
public void adminAdd(HttpServletRequest reqHttpServletResponse res)
{
String userName=req.getParameter(“userName“);
String userPw=req.getParameter(“userPw“);
String sql=“insert into t_admin values(??)“;
object[] params={userNameuserPw};
DB mydb=new DB();
mydb.doPstm(sql params);
mydb.closed();
req.setAttribute(“message“ “操作成功“);
req.setAttribute(“path“ “admin?type=adminMana“);
String targetURL = “/common/success.jsp“;
dispatch(targetURL req res);
}
public void adminDel(HttpServletRequest reqHttpServletResponse res)
{
System.out.println(req.getParameter(“userId“)+“**“);
String sql=“delete from t_admin where userId=“+Integer.parseInt(req.getParameter(“userId“));
object[] params={};
DB mydb=new DB();
mydb.doPstm(sql params);
mydb.closed();
req.setAttribute(“message“ “操作成功“);
req.setAttribute(“path“ “admin?type=adminMana“);
String targetURL = “/common/success.jsp“;
dispatch(targetURL req res);
}
public void dispatch(String targetURIHttpServletRequest requestHttpServletResponse response)
{
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
try
{
dispatch.forward(request response);
return;
}
catch (ServletException e)
{
e.printStackTrace();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8150 2017-09-10 10:19 JavaWeb新闻管理系统\db_news.sql
文件 2559 2017-12-31 19:14 JavaWeb新闻管理系统\news\.classpath
文件 285 2017-09-09 09:58 JavaWeb新闻管理系统\news\.myme
文件 1747 2017-04-23 16:33 JavaWeb新闻管理系统\news\.project
文件 500 2017-04-23 16:33 JavaWeb新闻管理系统\news\.settings\.jsdtscope
文件 173 2017-12-31 19:14 JavaWeb新闻管理系统\news\.settings\com.genuitec.eclipse.migration.prefs
文件 106 2017-12-31 19:35 JavaWeb新闻管理系统\news\.settings\org.eclipse.core.resources.prefs
文件 395 2017-04-23 16:33 JavaWeb新闻管理系统\news\.settings\org.eclipse.jdt.core.prefs
文件 474 2017-12-31 19:14 JavaWeb新闻管理系统\news\.settings\org.eclipse.wst.common.component
文件 359 2017-12-31 19:14 JavaWeb新闻管理系统\news\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-04-23 16:33 JavaWeb新闻管理系统\news\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-04-23 16:33 JavaWeb新闻管理系统\news\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 3219 2013-05-12 20:29 JavaWeb新闻管理系统\news\src\com\action\admin_servlet.java
文件 4372 2017-09-10 10:06 JavaWeb新闻管理系统\news\src\com\action\catelog_servlet.java
文件 5269 2013-05-12 20:29 JavaWeb新闻管理系统\news\src\com\action\gonggao_servlet.java
文件 2926 2013-05-12 20:29 JavaWeb新闻管理系统\news\src\com\action\index_servlet.java
文件 4920 2017-09-10 09:42 JavaWeb新闻管理系统\news\src\com\action\liuyan_servlet.java
文件 5404 2017-09-10 09:59 JavaWeb新闻管理系统\news\src\com\action\news_servlet.java
文件 5387 2017-09-10 09:52 JavaWeb新闻管理系统\news\src\com\action\user_servlet.java
文件 2163 2017-12-31 19:19 JavaWeb新闻管理系统\news\src\com\dao\DB.java
文件 552 2017-04-26 14:05 JavaWeb新闻管理系统\news\src\com\orm\TAdmin.java
文件 715 2017-04-26 14:07 JavaWeb新闻管理系统\news\src\com\orm\Tcatelog.java
文件 663 2017-04-26 14:08 JavaWeb新闻管理系统\news\src\com\orm\Tgonggao.java
文件 1030 2017-04-26 14:10 JavaWeb新闻管理系统\news\src\com\orm\Tliuyan.java
文件 1166 2017-04-26 14:13 JavaWeb新闻管理系统\news\src\com\orm\Tnews.java
文件 1603 2017-04-26 14:11 JavaWeb新闻管理系统\news\src\com\orm\Tuser.java
文件 1888 2013-05-12 20:29 JavaWeb新闻管理系统\news\src\com\service\liuService.java
文件 4344 2013-05-12 20:29 JavaWeb新闻管理系统\news\src\com\service\loginService.java
文件 1216 2013-05-12 20:29 JavaWeb新闻管理系统\news\src\com\util\EncodingFilter.java
文件 2552 2013-05-12 20:29 JavaWeb新闻管理系统\news\WebRoot\admin\admin\adminAdd.jsp
............此处省略908个文件信息
相关资源
- JavaWeb停车场管理系统(源代码,数据
- 基于JAVAweb的教务排课系统
- 锐聘学院QST青软JavaWeb十二个打包
- javaweb网上购物系统源码(附数据库脚
- javaweb校园宿舍系统(附数据库脚本)
- JavaWeb书城项目(附数据库脚本)
- 基于SSH框架的JavaWeb项目—人员信息管
- javaweb实现的邮件收发系统(附数据库
- java web知识点总结思维导图
- java web项目案例——知识管理软
- 博客系统笔记以及源码
- 李兴华JavaWeb培训经典笔记
- javaweb程序源码
- 基于JavaWeb的美食图片分享网站.zip
- JavaWeb-学生在线选课系统
- JavaWeb经典项目-图书管理系统
- 二手房屋交易系统
- 网络购物商城项目-12个项目
- 毕设:基于javaweb的宿舍管理系统
- javaweb政府oa代码
- 基于SSM框架的网上书店商城项目系统
- 旅游平台JAVA WEB
- JavaWeb网上图书商城完整项目资料
- JavaWeb开发的BBS系统
- SSM+Mysql实现防慕课网项目.zip
- Java Web开发实战经典
- 深入分析JavaWeb技术内幕修订版_13596
- JavaWEB商城项目(包括数据库)
- 基于JavaWeb的网上书店的设计与实现毕
- 基于JavaWeb学生管理系统
评论
共有 条评论