基于javaweb+mysql的jsp+servlet旅游管理系统(java+jsp+javascript+servlet+struts+mysql)

基于javaweb+mysql的jsp+servlet旅游管理系统(java+jsp+javascript+servlet+struts+mysql)

运行环境

Java≥8、MySQL≥5.7、Tomcat≥8

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb+mysql的JSP+Servlet旅游管理系统(java+jsp+javascript+servlet+struts+mysql)

项目介绍

本项目包含前后台,前台为普通用户登录,后台为管理员登录;

管理员角色包含以下功能:

管理员登陆,管理员管理,网站公告管理,酒店和旅行社管理,宾馆信息管理,用户信息管理,预定信息管理,留言管理,宾馆预定管理等功能。

用户角色包含以下功能: 用户注册,用户登陆,景点介绍,酒店信息查看,旅行社查看,留言板,宾馆预定,宾馆预订管理,个人中心管理等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:否;

技术栈

1.后端:servlet+struts 2.前端:JSP+CSS+JavaScript+jsp+mysql

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中util/DBO.java配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ 登录 管理员账号/密码:admin/admin 用户账号/密码: user/123456

/**
 * 前台会员登录 退出
 * 
 */

public class LoginAction extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public LoginAction() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * 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 {
			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.setAttribute("message", "登录成功,登录信息更新失败!");
					request.getRequestDispatcher("login1.jsp").forward(request, response);
				}
			}
			else if(flag == Constant.NAME_ERROR){//用户名错误
				request.setAttribute("reg_user", reg_user);
				request.setAttribute("message", "该用户名不存在或者已被管理员冻结!");
				request.getRequestDispatcher("login1.jsp").forward(request, response);
			}
			else if(flag == Constant.PASSWORD_ERROR){//密码错误
				request.setAttribute("reg_user", reg_user);
				request.setAttribute("message", "密码错误!");
				request.getRequestDispatcher("login1.jsp").forward(request, response);
			}
		}
		else if(method.equals("PAGEUSERLOGIN")){//登录页面会员登录
			String username = Filter.escapeHTMLTags(request.getParameter("username").trim());
			String password = Filter.escapeHTMLTags(request.getParameter("password").trim());
			String reg_type = Filter.escapeHTMLTags(request.getParameter("reg_type").trim());
			String lastip = request.getRemoteAddr();
			int flag = memberBean.memberLogin(username, password, reg_type);
			if(flag == Constant.SUCCESS){//登录成功
				String info = memberBean.getLastTimeIP(username);
				int flag2 = memberBean.upmemberLogin(username, lastip);
				if(flag2 == Constant.SUCCESS){
        m_request = httpservletrequest;
        m_response = httpservletresponse;
    }

    public void upload() throws ServletException,IOException,SmartUploadException
    {
        int i = 0;
        //boolean flag = false;
        boolean flag1 = false;
        //boolean flag2 = false;
        long l = 0L;
        //String s = "";//new String();
        //String s2 = "";//new String();
        String s4 = ""; //new String();
        String s5 = ""; //new String();
        String s6 = ""; //new String();
        String s7 = ""; //new String();
        String s8 = ""; //new String();
        String s9 = ""; //new String();
        String s10 = ""; //new String();
        m_totalBytes = m_request.getContentLength();
        m_binArray = new byte[m_totalBytes];
        int j;
        for(;i < m_totalBytes;i += j)
        {
            try
            {
                m_request.getInputStream();
                j = m_request.getInputStream().read(m_binArray,i,m_totalBytes - i);
            }
            catch(Exception exception)
            {
                throw new SmartUploadException("Unable to upload.");
            }
        }

        for(;!flag1 && m_currentIndex < m_totalBytes;m_currentIndex++)
        {
            if(m_binArray[m_currentIndex] == 13)
            {
                flag1 = true;
            }
            else
            {
                m_boundary = m_boundary + (char)m_binArray[m_currentIndex];

            }
        }
        m_allowedFilesList = new Vector();
        m_denyPhysicalPath = false;
        //m_forcePhysicalPath = false;
        m_contentDisposition = ""; //new String();
        m_files = new SmartFiles();
        m_formRequest = new SmartRequest();
    }

    /**
     * @deprecated Method init is deprecated
     */
    public final void init(ServletConfig servletconfig) throws ServletException
    {
        m_application = servletconfig.getServletContext();
    }

    /**
     * @deprecated Method service is deprecated
     */
    public void service(HttpServletRequest httpservletrequest,HttpServletResponse httpservletresponse) throws ServletException,IOException
    {
        m_request = httpservletrequest;
        m_response = httpservletresponse;
    }

    public final void initialize(ServletConfig servletconfig,HttpServletRequest httpservletrequest,HttpServletResponse httpservletresponse) throws ServletException
    {
        m_application = servletconfig.getServletContext();
        m_request = httpservletrequest;
        m_response = httpservletresponse;
    }

    public final void initialize(PageContext pagecontext) throws ServletException
    {
        m_application = pagecontext.getServletContext();
        m_request = (HttpServletRequest)pagecontext.getRequest();
        m_response = (HttpServletResponse)pagecontext.getResponse();
    }

    /**
     * @deprecated Method initialize is deprecated
     */
    public final void initialize(ServletContext servletcontext,HttpSession httpsession,HttpServletRequest httpservletrequest,HttpServletResponse httpservletresponse,JspWriter jspwriter) throws ServletException
    {
        m_application = servletcontext;
        m_request = httpservletrequest;
        m_response = httpservletresponse;
    }

    public void upload() throws ServletException,IOException,SmartUploadException
    {
        int i = 0;
        int j = 0;
        if(s == null)
        {
            throw new IllegalArgumentException("There is no specified destination file (1025).");
        }
        if(s.length() == 0)
        {
            throw new IllegalArgumentException("There is no specified destination file (1025).");
        }
        if(!isVirtual(s) && m_denyPhysicalPath)
        {
            throw new SecurityException("Physical path is denied (1035).");
        }
        i = m_request.getContentLength();
        m_binArray = new byte[i];
        int k;
        for(;j < i;j += k)
        {
            try
            {
                k = m_request.getInputStream().read(m_binArray,j,i - j);
            }
            catch(Exception exception)
            {
                throw new SmartUploadException("Unable to upload.");
            }
        }

        if(isVirtual(s))
        {
            s = m_application.getRealPath(s);
        }
        try
        {
            java.io.File file = new java.io.File(s);
            FileOutputStream fileoutputstream = new FileOutputStream(file);
            fileoutputstream.write(m_binArray);
            fileoutputstream.close();
        }
        catch(Exception exception1)
        {
            throw new SmartUploadException("The Form cannot be saved in the specified file (1030).");
        }
    }

    private boolean isVirtual(String s)
	 * 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(request,response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * 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);
		String sysdir = new SystemBean().getDir();
		HttpSession session = request.getSession();
		try{
			String username2 = (String)session.getAttribute("user");
			if(username2 == null){
				request.getRequestDispatcher("error.jsp").forward(request, response);
			}
			else{
				AfficheBean afficheBean = new AfficheBean();
				String method = request.getParameter("method").trim();
				if(method.equals("addAffiche")){//增加公告
					String title = Filter.escapeHTMLTags(request.getParameter("title").trim());
					String content = Filter.escapeHTMLTags(request.getParameter("content").trim());
					String adder = username2;
					String ifhide = Filter.escapeHTMLTags(request.getParameter("ifhide").trim());
					int flag = afficheBean.addAffiche(title, content, adder, ifhide);
					if(flag == Constant.SUCCESS){
						request.setAttribute("message", "操作成功!");
						request.getRequestDispatcher(sysdir+"/affiche/index.jsp").forward(request, response);
					}
					else{
						request.setAttribute("message", "系统维护中请稍后再试!");
						request.getRequestDispatcher(sysdir+"/affiche/index.jsp").forward(request, response);
					}
    }

    public SmartRequest getRequest()
    {
        return m_formRequest;
    }

    public void downloadFile(String s) throws ServletException,IOException,SmartUploadException
    {
        downloadFile(s,null,null);
    }

    public void downloadFile(String s,String s1) throws ServletException,IOException,SmartUploadException,SmartUploadException
    {
        downloadFile(s,s1,null);
    }

    public void downloadFile(String s,String s1,String s2) throws ServletException,IOException,SmartUploadException
    {
        downloadFile(s,s1,s2,65000);
    }

    public void downloadFile(String s,String s1,String s2,int i) throws ServletException,IOException,SmartUploadException
    {
        if(s == null)
        {
            throw new IllegalArgumentException("File '" + s + "' not found (1040).");
        }
        if(s.equals(""))
        {
            throw new IllegalArgumentException("File '" + s + "' not found (1040).");
        }
        if(!isVirtual(s) && m_denyPhysicalPath)
        {
            throw new SecurityException("Physical path is denied (1035).");
        }
        if(isVirtual(s))
        {
            s = m_application.getRealPath(s);
        }
        java.io.File file = new java.io.File(s);
        FileInputStream fileinputstream = new FileInputStream(file);
					else{
						int flag = loginbean.delManager(id);
						if(flag == Constant.SUCCESS){
							request.setAttribute("message", "删除成功!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}	
						else{
							request.setAttribute("message", "系统维护中,请稍后再试!");
							request.getRequestDispatcher(sysdir+"/system/user.jsp").forward(request, response);
						}	
					}
				}			
			}
			else if(method.equals("dellog")){//delete login note
				String username2 = (String)session.getAttribute("user");
				if(username2 == null){
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
				else{
					String check[] = request.getParameterValues("checkit");
					if(check == null){
						request.setAttribute("message", "请选择要删除的记录!");
						request.getRequestDispatcher(sysdir+"/system/log.jsp").forward(request, response);
					}
					else{
						int id[]= new int[check.length];
						for(int i = 0;i<check.length;i++){
							int s = Integer.parseInt(check[i]);				
							id[i] = s;
						}
						int flag = loginbean.delLog(id);
						if(flag == Constant.SUCCESS){
							request.setAttribute("message", "删除记录成功!");
							request.getRequestDispatcher(sysdir+"/system/log.jsp").forward(request, response);
						}
						else{
							request.setAttribute("message", "系统维护中,请稍后再试!");
							request.getRequestDispatcher(sysdir+"/system/log.jsp").forward(request, response);
						}
					}
				}			
			}
			else{//无参数传入转到错误页面
				request.getRequestDispatcher("error.jsp").forward(request, response);
			}
		}catch(Exception e){
			e.printStackTrace();
			request.getRequestDispatcher("error.jsp").forward(request, response);
		}
        }

        if(isVirtual(s))
        {
            s = m_application.getRealPath(s);
        }
        try
        {
            java.io.File file = new java.io.File(s);
            FileOutputStream fileoutputstream = new FileOutputStream(file);
            fileoutputstream.write(m_binArray);
            fileoutputstream.close();
        }
        catch(Exception exception1)
        {
            throw new SmartUploadException("The Form cannot be saved in the specified file (1030).");
        }
    }

    private boolean isVirtual(String s)
    {
        if(m_application.getRealPath(s) != null)
        {
            java.io.File file = new java.io.File(m_application.getRealPath(s));
            return file.exists();
        }
        else
        {
            return false;
        }
    }
}

/**
 * 新闻管理-上传缩略图
 * 
 */

	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doPost(request,response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * 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);
		String sysdir = new SystemBean().getDir();
		HttpSession session = request.getSession();
		try{
			String username2 = (String)session.getAttribute("user");
			if(username2 == null){
				request.getRequestDispatcher("error.jsp").forward(request, response);
			}
			else{
				AfficheBean afficheBean = new AfficheBean();
				String method = request.getParameter("method").trim();
				if(method.equals("addAffiche")){//增加公告
					String title = Filter.escapeHTMLTags(request.getParameter("title").trim());
					String content = Filter.escapeHTMLTags(request.getParameter("content").trim());
					String adder = username2;
					String ifhide = Filter.escapeHTMLTags(request.getParameter("ifhide").trim());
					int flag = afficheBean.addAffiche(title, content, adder, ifhide);
					if(flag == Constant.SUCCESS){
						request.setAttribute("message", "操作成功!");
						request.getRequestDispatcher(sysdir+"/affiche/index.jsp").forward(request, response);
					}
					else{
						request.setAttribute("message", "系统维护中请稍后再试!");
						request.getRequestDispatcher(sysdir+"/affiche/index.jsp").forward(request, response);
					}
				}
				else if(method.equals("editAffiche")){//修改公告
					String id=Filter.escapeHTMLTags(request.getParameter("id").trim());
					String title = Filter.escapeHTMLTags(request.getParameter("title").trim());
					String content = Filter.escapeHTMLTags(request.getParameter("content").trim());
					String adder = username2;
					String ifhide = Filter.escapeHTMLTags(request.getParameter("ifhide").trim());
					int flag = afficheBean.updateAffiche(Integer.parseInt(id), title, content, adder, ifhide);
	public NewsAction() {
		super();
	}

	final public void init(ServletConfig config) throws ServletException
    {
        this.config = config;  
    }

    final public ServletConfig getServletConfig()
    {
        return config;
    }
	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * 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(request,response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * 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
					int flag = new NewsBean().upNews(Integer.parseInt(id));
					if(flag == Constant.SUCCESS){
						request.getRequestDispatcher(sysdir+"/news/index.jsp").forward(request, response);
					}
					else{
						request.setAttribute("message", "系统维护中,请稍后再试!");
						request.getRequestDispatcher(sysdir+"/news/index.jsp").forward(request, response);
					}
				}
//				if(method.equals("DELUPNEWS")){//删除新闻 来自置顶新闻页面up.jsp
//					String strDirPath = request.getSession().getServletContext().getRealPath("/");
//					String check[] = request.getParameterValues("checkit");
//        			if(check == null){
//						request.setAttribute("message", "请选择要删除的记录!");
//						request.getRequestDispatcher(sysdir+"/news/up.jsp").forward(request, response);
//					}
//					else{
//						int id2[]= new int[check.length];
//						for(int i = 0;i<check.length;i++){
//							int s = Integer.parseInt(check[i]);				
//							id2[i] = s;
//						}
//						int flag = new NewsBean().delNews(id2,strDirPath); 
//						if(flag == Constant.SUCCESS){
//							request.getRequestDispatcher(sysdir+"/news/up.jsp").forward(request, response);
//						}
//						else{
//							request.setAttribute("message", "系统维护中,请稍后再试!");
//							request.getRequestDispatcher(sysdir+"/news/up.jsp").forward(request, response);
//						}
//					}
//				}
				
				
				else{
	            	request.getRequestDispatcher("error.jsp").forward(request, response);
	            }
			}
		}catch(Exception e){
			
		}
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
						else{
							SmartFile file = mySmartUpload.getFiles().getFile(0);
			            	String fileExt=file.getFileExt();	            
			            	String path="/upload_file/sale";
		                    count = mySmartUpload.save(path);
		                    String sql="insert into sale(title,url,dz,yb,dh,jd,content,addtime) " +
		                    		"values('"+title+"','"+path+"/"+file.getFileName()+"','"+dz+"','"+yb+"','"+dh+"','"+jd+"','"+content+"','"+date+"')";
		                   int flag = new NewsBean().exeUp(sql);
							if(flag == Constant.SUCCESS){
								request.setAttribute("message", "操作成功!");
								request.getRequestDispatcher(sysdir+"/hzp/index.jsp").forward(request, response);
							}
							else{
								request.setAttribute("message", "系统维护中,请稍后再试!");
								request.getRequestDispatcher(sysdir+"/hzp/index.jsp").forward(request, response);
							}
						}
		            }
		            //update
		            else if(method.equals("uplvyou")){
		            	String id = mySmartUpload.getRequest().getParameter("id");
		            	String title = mySmartUpload.getRequest().getParameter("title");
						String dz = mySmartUpload.getRequest().getParameter("dz");
						String yb = mySmartUpload.getRequest().getParameter("yb");
						String dh = mySmartUpload.getRequest().getParameter("dh");
						String jd = mySmartUpload.getRequest().getParameter("jd");
						String content = mySmartUpload.getRequest().getParameter("infoContent");
						String flag11 = mySmartUpload.getRequest().getParameter("flag");
						if(content.length()>8000){
						request.setAttribute("message", "对不起,内容不能超过8000个字符!");
						request.setAttribute("method", method);
						request.getRequestDispatcher(sysdir+"/hzp/add.jsp").forward(request, response);
						}
						else{
							SmartFile file = mySmartUpload.getFiles().getFile(0);
			            	String fileExt=file.getFileExt();	            
			            	String path="/upload_file/sale";
		                    count = mySmartUpload.save(path);
		                    String sql="update sale set title='"+title+"',url='"+path+"/"+file.getFileName()+"',dz='"+dz+"'," +
		                    		"yb='"+yb+"',dh='"+dh+"',jd='"+jd+"',content='"+content+"' where id='"+id+"'";
		                    int flag = new NewsBean().exeUp(sql);
							if(flag == Constant.SUCCESS){
								request.setAttribute("message", "操作成功!");
								request.getRequestDispatcher(sysdir+"/hzp/index.jsp").forward(request, response);
							}
							else{
								request.setAttribute("message", "系统维护中,请稍后再试!");
	}

	final public void init(ServletConfig config) throws ServletException
    {
        this.config = config;  
    }

    final public ServletConfig getServletConfig()
    {
        return config;
    }
	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *
	 * 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(request,response);
	}

	/**
	 * The doPost method of the servlet. <br>
	 *
	 * 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
            }
        }
        m_response.setContentLength(abyte0.length);
        if(s2 == null)
        {
            m_response.setHeader("Content-Disposition","attachment;");
        }
        else
        {
            if(s2.length() == 0)
            {
                m_response.setHeader("Content-Disposition","attachment;");
            }
            else
            {
                m_response.setHeader("Content-Disposition","attachment; filename=" + s2);
            }
        }
        m_response.getOutputStream().write(abyte0,0,abyte0.length);
    }

    public void fieldToFile(ResultSet resultset,String s,String s1) throws ServletException,IOException,SmartUploadException,SQLException
    {
        try
        {
            if(m_application.getRealPath(s1) != null)
            {
                s1 = m_application.getRealPath(s1);
            }
            InputStream inputstream = resultset.getBinaryStream(s);
            FileOutputStream fileoutputstream = new FileOutputStream(s1);
            int i;
            while((i = inputstream.read()) != -1)
            {
                fileoutputstream.write(i);
            }
            fileoutputstream.close();
        }
        catch(Exception exception)
        {
            throw new SmartUploadException("Unable to save file from the DataBase (1020).");
        }
    }
			String telphone = Filter.escapeHTMLTags(request.getParameter("telphone").trim());
			String email = Filter.escapeHTMLTags(request.getParameter("email").trim());
			String question = Filter.escapeHTMLTags(request.getParameter("question").trim());
			String answer = Filter.escapeHTMLTags(request.getParameter("answer").trim());
			String address = Filter.escapeHTMLTags(request.getParameter("address").trim());
			String lastip = request.getRemoteAddr();
			int off = 1;
			int flag = memberBean.personReg(username, password, type, realname, sex, bir,sheng,city, telphone, email, question, answer, lastip, off,address);
			if(flag == Constant.SUCCESS){
					List siteList = new SystemBean().getSiteInfo();
					String sitename = siteList.get(0).toString();
					request.setAttribute("message", "注册成功!恭喜您成为"+sitename+"的注册会员!");
					request.getRequestDispatcher("login.jsp").forward(request, response);
				
			}
			else{
				request.setAttribute("message", "系统维护中,请稍后再试!");
				request.getRequestDispatcher("personreg.jsp").forward(request, response);
			}
		}
		else if(method.equals("UPREGINFO")){//个人会员修改资料
			String member=(String)session.getAttribute("member");
			String type=(String)session.getAttribute("type");
			if(member==null||type==null){
				response.sendRedirect("error.jsp");
			}
			else{
				String realname = Filter.escapeHTMLTags(request.getParameter("realname").trim());
				String sex = Filter.escapeHTMLTags(request.getParameter("sex").trim());
				String sheng = Filter.escapeHTMLTags(request.getParameter("sheng").trim());
				String city = Filter.escapeHTMLTags(request.getParameter("city").trim());
				String bir = Filter.escapeHTMLTags(request.getParameter("bir").trim());
				String telphone = Filter.escapeHTMLTags(request.getParameter("telphone").trim());
				String email = Filter.escapeHTMLTags(request.getParameter("email").trim());
				String question = Filter.escapeHTMLTags(request.getParameter("question").trim());
				String answer = Filter.escapeHTMLTags(request.getParameter("answer").trim());
				String address = Filter.escapeHTMLTags(request.getParameter("address").trim());
				int flag = memberBean.uppersonReg(member, realname, sex, bir, sheng, city, telphone, email, question, answer,address);
				if(flag == Constant.SUCCESS){					
					request.setAttribute("message", "操作成功!");
					request.getRequestDispatcher("member/info/info.jsp").forward(request, response);
				}
				else{
					request.setAttribute("message", "系统维护中,请稍后再试!");
						int flag = guestBookBean.upReplay(Integer.parseInt(messageid), replay);
						if(flag == Constant.SUCCESS){
							request.setAttribute("message", "修改成功!");
							request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response);
						}
						else{
							request.setAttribute("message", "系统维护中,请稍后再试!");
							request.getRequestDispatcher(sysdir+"/guestbook/index.jsp").forward(request, response);
						}
					}
				}catch(Exception e){
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
			}
			else{
				request.getRequestDispatcher("error.jsp").forward(request, response);
			}
			
	}
	
	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occure
	 */
	public void init() throws ServletException {
		// Put your code here
	}
}

/**
 * 
 * 网站后台管理注册会员 查询 冻结 删除会员
 */		

	}
}

/**
 * 
 * 网站后台管理注册会员 查询 冻结 删除会员
 */		

public class MemberManageAction extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public MemberManageAction() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	/**
	 * The doGet method of the servlet. <br>
	 *

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值