資源簡介
Java+Servlet+JavaBean+MySQL+Tomcat實現的網上超市系統,代碼風格簡潔易懂,是計算機及軟件工程專業同學大三及大四課程設計的首選。
該壓縮包內含程序源代碼,sql數據庫代碼和課程設計文檔,是在下嘔心之作,10分絕對是物有所值呀……
代碼片段和文件信息
package?wyf.hxl;
import?java.io.*;
import?java.util.*;
import?javax.servlet.*;
import?javax.servlet.http.*;
public?class?CustomerServlet?extends?HttpServlet?{
public?void?doGet(HttpServletRequest?request?HttpServletResponse?response)
throws?ServletException?IOException?{
this.doPost(request?response);
}
public?void?doPost(HttpServletRequest?request?HttpServletResponse?response)
throws?ServletException?IOException?{
request.setCharacterEncoding(“gb2312“);
response.setCharacterEncoding(“gb2312“);
response.setContentType(“text/html;charset=gb2312“);
HttpSession?session?=?request.getSession(true);
PrintWriter?out?=?response.getWriter();
PaginationBean?handlePage?=?(PaginationBean)?session
.getAttribute(“handlePage“);
if?(handlePage?==?null)?{
handlePage?=?new?PaginationBean();
session.setAttribute(“handlePage“?handlePage);
}
String?action?=?request.getParameter(“action“);
if?(action?==?null)?{
return;
}
if?(action.equals(“denglu“))?{
String?zname?=?request.getParameter(“zname“);
String?zpassword?=?request.getParameter(“zpassword“);
String?cname?=?new?String(zname.getBytes()?“gb2312“);
String?sql?=?“select?cname?from?gcustomer?where?cname=‘“?+?cname
+?“‘?and?cpw=‘“?+?zpassword?+?“‘“;
boolean?s?=?DB.selectMsg(sql);
String?code=request.getParameter(“code“);
HttpSession?sessiontemp?=?request.getSession();
String?randStr=(String)sessiontemp.getAttribute(“randStr“);
if(!code.equals(randStr)){
String?msg?=?“驗證碼輸入錯誤,請重新輸入!“;
request.setAttribute(“msg“msg);
ServletContext?sc?=?getServletContext(); //得到上下文?
RequestDispatcher?rd?=?sc.getRequestDispatcher(“/customermanage.jsp“);
rd.forward(requestresponse);
return;
}
if?(s)?{
session.setAttribute(“user“?zname);
String?fromWhere?=?(String)?session.getAttribute(“fromWhere“);
if?(fromWhere?!=?null)?{
if?(fromWhere.equals(“jz“))?{//?回結賬
this.getServletContext()
.getRequestDispatcher(
“/CustomerServlet?action=jiezhang“)
.forward(request?response);
return;
}?else?if?(fromWhere.equals(“wddd“))?{//?回我的訂單
this.getServletContext()
.getRequestDispatcher(
“/CustomerServlet?action=modify2“)
.forward(request?response);
return;
}?else?if?(fromWhere.equals(“mmcz“))?{//?回密碼重置
this.getServletContext()
.getRequestDispatcher(“/customerpwchange.jsp“)
.forward(request?response);
return;
}
}
this.getServletContext()
.getRequestDispatcher(“/pagination.jsp“)
.forward(request?response);
}?else?{
String?msg?=?“對不起登錄失敗請重新登錄!!!“;
request.setAttribute(“msg“?msg);
this.getServletContext()
.getRequestDispatcher(“/customermanage.jsp“)
.forward(request?response);
}
}?else?if?(action.equals(“zhuce“))?{
String?zname?=?request.getParameter(“cname“);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-11-17?14:39??課程設計電子版\
?????目錄???????????0??2013-11-13?20:28??課程設計電子版\chaoshi\
?????文件?????????529??2013-10-28?16:47??課程設計電子版\chaoshi\.classpath
?????目錄???????????0??2013-11-17?14:47??課程設計電子版\chaoshi\.myeclipse\
?????文件?????????294??2013-10-28?16:47??課程設計電子版\chaoshi\.myme
?????文件????????1750??2013-10-28?16:53??課程設計電子版\chaoshi\.project
?????目錄???????????0??2013-11-13?20:28??課程設計電子版\chaoshi\.settings\
?????文件?????????500??2013-10-28?16:47??課程設計電子版\chaoshi\.settings\.jsdtscope
?????文件?????????395??2013-10-28?16:47??課程設計電子版\chaoshi\.settings\org.eclipse.jdt.core.prefs
?????文件?????????459??2013-10-28?16:47??課程設計電子版\chaoshi\.settings\org.eclipse.wst.common.component
?????文件?????????252??2013-10-28?16:47??課程設計電子版\chaoshi\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2013-10-28?16:47??課程設計電子版\chaoshi\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2013-10-28?16:47??課程設計電子版\chaoshi\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2013-11-13?20:29??課程設計電子版\chaoshi\WebRoot\
?????目錄???????????0??2013-11-13?20:29??課程設計電子版\chaoshi\WebRoot\me
?????文件??????????36??2013-10-28?16:47??課程設計電子版\chaoshi\WebRoot\me
?????目錄???????????0??2013-11-13?20:29??課程設計電子版\chaoshi\WebRoot\WEB-INF\
?????目錄???????????0??2013-11-13?20:29??課程設計電子版\chaoshi\WebRoot\WEB-INF\classes\
?????目錄???????????0??2013-11-13?20:29??課程設計電子版\chaoshi\WebRoot\WEB-INF\classes\wyf\
?????目錄???????????0??2013-11-13?20:29??課程設計電子版\chaoshi\WebRoot\WEB-INF\classes\wyf\hxl\
?????文件???????20615??2013-11-01?18:47??課程設計電子版\chaoshi\WebRoot\WEB-INF\classes\wyf\hxl\CustomerServlet.class
?????文件????????7850??2013-11-01?18:47??課程設計電子版\chaoshi\WebRoot\WEB-INF\classes\wyf\hxl\DB.class
?????文件????????1415??2013-11-01?18:47??課程設計電子版\chaoshi\WebRoot\WEB-INF\classes\wyf\hxl\ManageBean.class
?????文件???????18560??2013-11-01?18:47??課程設計電子版\chaoshi\WebRoot\WEB-INF\classes\wyf\hxl\ManageServlet.class
?????文件????????4086??2013-11-01?18:47??課程設計電子版\chaoshi\WebRoot\WEB-INF\classes\wyf\hxl\PaginationBean.class
?????目錄???????????0??2013-11-17?14:47??課程設計電子版\chaoshi\WebRoot\WEB-INF\lib\
?????文件????????1548??2013-10-29?22:52??課程設計電子版\chaoshi\WebRoot\WEB-INF\web.xm
?????文件?????????231??2013-10-31?14:35??課程設計電子版\chaoshi\WebRoot\admindl.jsp
?????文件?????????634??2013-10-31?14:37??課程設計電子版\chaoshi\WebRoot\almintop.jsp
?????文件????????3612??2013-10-31?14:53??課程設計電子版\chaoshi\WebRoot\cart.jsp
?????文件?????????915??2013-10-30?13:49??課程設計電子版\chaoshi\WebRoot\code.jsp
............此處省略155個文件信息
評論
共有 條評論