资源简介
商品管理,商品分类和查询,到购物车实现,用户订单处理,再到管理员系统。
代码片段和文件信息
package com.action;
/**
* 前台会员登陆 退出
*
*/
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bean.MemberBean;
import com.util.Constant;
import com.util.Filter;
public class LoginServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public LoginServlet() {
super();
}
/**
* Destruction of the servlet.
*/
public void destroy() {
super.destroy(); // Just puts “destroy“ string in log
// Put your code here
}
/**
* The doGet method of the servlet.
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
doPost(requestresponse);
}
/**
* The doPost method of the servlet.
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
response.setContentType(Constant.CONTENTTYPE);
request.setCharacterEncoding(Constant.CHARACTERENCODING);
HttpSession session = request.getSession();
MemberBean memberBean = new MemberBean();
String method = Filter.escapeHTMLTags(request.getParameter(“method“).trim());
if(method.equals(“HEADUSERLOGIN“)){//网页头部会员登陆
String reg_user = Filter.escapeHTMLTags(request.getParameter(“reg_user“).trim());
String reg_pwd = Filter.escapeHTMLTags(request.getParameter(“reg_pwd“).trim());
String reg_type = Filter.escapeHTMLTags(request.getParameter(“reg_type“).trim());
String lastip = request.getRemoteAddr();
int flag = memberBean.memberLogin(reg_user reg_pwd reg_type);
if(flag == Constant.SUCCESS){//登陆成功
String info = memberBean.getLastTimeIP(reg_user);
int flag2 = memberBean.upmemberLogin(reg_user lastip);
if(flag2 == Constant.SUCCESS){
session.setAttribute(“member“ reg_user);
session.setAttribute(“type“ reg_type);
session.setAttribute(“info“ info);
request.getRequestDispatcher(“login1.jsp“).forward(request response);
}
else{
session.setAttribute(“member“ reg_user);
session.setAttribute(“type“ reg_type);
session.setAttribute(“info“ info);
session.setAtt
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 10675712 2015-05-22 13:33 052JSP化妆品销售网站\JSP化妆品销售网站录像.avi
文件 709 2009-04-29 11:18 052JSP化妆品销售网站\化妆品\hzp\.classpath
文件 282 2015-05-22 13:22 052JSP化妆品销售网站\化妆品\hzp\.myme
文件 1221 2009-04-29 11:18 052JSP化妆品销售网站\化妆品\hzp\.project
文件 6060 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\action\LoginServlet.java
文件 6690 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\action\MemberManageServlet.java
文件 10373 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\action\MemberServlet.java
文件 11551 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\action\NewsServlet.java
文件 14420 2012-11-17 18:19 052JSP化妆品销售网站\化妆品\hzp\src\com\bean\MemberBean.java
文件 16795 2012-11-17 18:18 052JSP化妆品销售网站\化妆品\hzp\src\com\bean\MemberManageBean.java
文件 13968 2012-11-17 18:18 052JSP化妆品销售网站\化妆品\hzp\src\com\bean\NewsBean.java
文件 318 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\util\CheckCode.java
文件 1838 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\util\Common.java
文件 533 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\util\Constant.java
文件 2491 2015-05-22 13:29 052JSP化妆品销售网站\化妆品\hzp\src\com\util\DBO.java
文件 650 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\util\Filter.java
文件 836 2012-11-17 17:52 052JSP化妆品销售网站\化妆品\hzp\src\com\util\Log.java
文件 838 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\if
文件 2418 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\if
文件 1227 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\if
文件 838 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\if
文件 12091 2009-04-29 17:38 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\if
文件 1636 2009-04-29 12:34 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\if
文件 5213 2009-04-29 17:51 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\if
文件 10889 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\images\admin_m.swf
文件 6221 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\images\Admin_st
文件 876 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\images\bg.jpg
文件 315 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\images\bt_login.gif
文件 179 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\images\bullet.gif
文件 20734 2008-12-15 09:54 052JSP化妆品销售网站\化妆品\hzp\WebRoot\admin\images\calendar.js
............此处省略667个文件信息
- 上一篇:JAVA JSP汽车租赁系统
- 下一篇:db2jcc4的使用
评论
共有 条评论