• 大小: 10.3MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-24
  • 语言: Java
  • 标签: javaweb  

资源简介

这是发了我几个星期尽心尽力写的一个基于javaweb的网上商城,用于在校答辩效果很好,一定不会让你们失望,希望采纳!

资源截图

代码片段和文件信息

package controller;

import java.io.IOException;
import java.lang.reflect.Method;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import daoimpl.GoodsDaoimpl;
import daoimpl.OrderDaoimpl;
import daoimpl.TypeDaoimpl;
import daoimpl.UserDaoimpl;
import po.Goods;
import po.Orders;
import po.TypeSos;
import po.UserInfo;

/**
 * Servlet implementation class BackstageprocessingServlet
 */
public class BackstageprocessingServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
    /**
     * @see HttpServlet#HttpServlet()
     */
    public BackstageprocessingServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

/**
 * @see HttpServlet#doGet(HttpServletRequest request HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
doPost(requestresponse);
}

/**
 * @see HttpServlet#doPost(HttpServletRequest request HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
        String methodName = request.getParameter(“method“);
try {
Method method = getClass().getDeclaredMethod(methodName HttpServletRequest.class HttpServletResponse.class);
method.setAccessible(true);
method.invoke(this request response);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}

protected void getalluser(HttpServletRequest request HttpServletResponse response) throws ServletException IOException 
{
System.out.println(“getalluser“);
UserDaoimpl users=new UserDaoimpl();
List userlist=users.getalluser();
request.setAttribute(“userlist“ userlist);
request.getRequestDispatcher(“index.jsp“).forward(request response);
System.out.println(userlist);
}
protected void adduser(HttpServletRequest request HttpServletResponse response) throws ServletException IOException 
{
System.out.println(“adduser“);
UserDaoimpl userdao= new UserDaoimpl();
String userName=request.getParameter(“userName“);
String passWord=request.getParameter(“passWord“);
String email=request.getParameter(“email“);
String realName=request.getParameter(“realName“);
String phone=request.getParameter(“phone“);
int  sexs=Integer.parseInt(request.getParameter(“sex“));
String sex=null;
if(sexs==1)
{
 sex=“男“;
}else{
 sex=“女“;
}


long count = userdao.getusernamext(userName);
System.out.println(count);
System.out.println(userName);


if(count > 0){

response.setCharacterEncoding(“UTF-8“);

response.setHeader(“content-type““text/html;charset=UTF-8“);
request.setAttribute(“message“ “用户名“+userName+“已被占

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        914  2018-06-20 09:27  网上商城\clpSos\.classpath

     文件       1039  2018-06-19 16:04  网上商城\clpSos\.project

     文件        567  2018-06-19 16:04  网上商城\clpSos\.settings\.jsdtscope

     文件         57  2018-06-19 16:05  网上商城\clpSos\.settings\org.eclipse.core.resources.prefs

     文件        364  2018-06-19 16:04  网上商城\clpSos\.settings\org.eclipse.jdt.core.prefs

     文件        470  2018-06-19 16:04  网上商城\clpSos\.settings\org.eclipse.wst.common.component

     文件        345  2018-06-19 16:04  网上商城\clpSos\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2018-06-19 16:04  网上商城\clpSos\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2018-06-19 16:04  网上商城\clpSos\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       1130  2018-06-20 09:43  网上商城\clpSos\build\classes\c3p0-config.xml

     文件      15256  2018-06-27 16:21  网上商城\clpSos\build\classes\controller\BackstageprocessingServlet.class

     文件       3419  2018-06-28 19:17  网上商城\clpSos\build\classes\controller\GoodsHandleServlet.class

     文件       4430  2018-06-28 10:10  网上商城\clpSos\build\classes\controller\UpdatefilterServlet.class

     文件       9990  2018-06-28 20:32  网上商城\clpSos\build\classes\controller\UserinfoHandleServlet.class

     文件        612  2018-06-27 17:06  网上商城\clpSos\build\classes\dao\GoodsDao.class

     文件        465  2018-06-25 15:35  网上商城\clpSos\build\classes\dao\OrderDao.class

     文件        160  2018-06-25 15:35  网上商城\clpSos\build\classes\dao\OrderDetailDao.class

     文件        332  2018-06-25 15:35  网上商城\clpSos\build\classes\dao\TypeDao.class

     文件        436  2018-06-26 11:10  网上商城\clpSos\build\classes\dao\UserDao.class

     文件       3505  2018-06-27 17:08  网上商城\clpSos\build\classes\daoimpl\GoodsDaoimpl.class

     文件       2848  2018-06-26 14:46  网上商城\clpSos\build\classes\daoimpl\OrderDaoimpl.class

     文件       2092  2018-06-26 14:45  网上商城\clpSos\build\classes\daoimpl\TypeDaoimpl.class

     文件       2820  2018-06-26 14:37  网上商城\clpSos\build\classes\daoimpl\UserDaoimpl.class

     文件       3220  2018-06-25 17:31  网上商城\clpSos\build\classes\po\Goods.class

     文件        839  2018-06-25 15:35  网上商城\clpSos\build\classes\po\GoodsVague.class

     文件       1933  2018-06-25 15:35  网上商城\clpSos\build\classes\po\OrderDetail.class

     文件       3244  2018-06-26 10:50  网上商城\clpSos\build\classes\po\Orders.class

     文件       2695  2018-06-25 15:35  网上商城\clpSos\build\classes\po\ShoppingCart.class

     文件        877  2018-06-25 15:35  网上商城\clpSos\build\classes\po\ShoppingCartItem.class

     文件       1913  2018-06-25 15:35  网上商城\clpSos\build\classes\po\TypeSos.class

............此处省略687个文件信息

评论

共有 条评论