资源简介
为前台和后台两大模块 电子商务类网站
代码片段和文件信息
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();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2062214 2012-07-25 07:27 587JSP+MYSQL汽车销售系统\JSP汽车销售管理系统luxiang.exe
文件 1628 2012-07-25 07:02 587JSP+MYSQL汽车销售系统\xiaoshou\.classpath
文件 297 2012-07-25 07:02 587JSP+MYSQL汽车销售系统\xiaoshou\.myme
文件 1226 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\.project
文件 3219 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\src\com\action\admin_servlet.java
文件 2121 2012-07-25 07:10 587JSP+MYSQL汽车销售系统\xiaoshou\src\com\dao\DB.java
文件 524 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\src\com\orm\TAdmin.java
文件 1565 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\src\com\orm\Txiaoshou.java
文件 2597 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\src\com\service\liuService.java
文件 1184 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\src\com\util\EncodingFilter.java
文件 88 2013-03-29 12:10 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\admin\index.jsp
文件 8498 2012-07-25 07:15 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\admin\menu.jsp
文件 4024 2012-07-25 07:16 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\admin\qiche\qicheAdd.jsp
文件 3082 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\admin\qiche\qicheAll.jsp
文件 2663 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\admin\qiche\qicheMana.jsp
文件 2895 2012-07-25 07:28 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\admin\top.jsp
文件 802 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\common\add_success.jsp
文件 821 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\common\msg.jsp
文件 797 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\common\success.jsp
文件 5008 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\css\ba
文件 795 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\css\dtree.css
文件 8828 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\css\layout.css
文件 2684 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\css\woncore.css
文件 236 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\fckeditor\editor\css\behaviors\disablehandles.htc
文件 822 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\fckeditor\editor\css\behaviors\showtableborders.htc
文件 2648 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\fckeditor\editor\css\fck_editorarea.css
文件 4088 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\fckeditor\editor\css\fck_internal.css
文件 1696 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\fckeditor\editor\css\fck_showtableborders_gecko.css
文件 288 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\fckeditor\editor\css\images\block_address.png
文件 293 2012-04-01 23:24 587JSP+MYSQL汽车销售系统\xiaoshou\WebRoot\fckeditor\editor\css\images\block_blockquote.png
............此处省略804个文件信息
评论
共有 条评论