基于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 NewsAction extends HttpServlet {

	private ServletConfig config;
	/**
	 * Constructor of the object.
	 */
	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 {
    {
        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);
        long l = file.length();
        //boolean flag = false;
        int k = 0;
        byte abyte0[] = new byte[i];
        if(s1 == null)
        {
            m_response.setContentType("application/x-msdownload");
        }
        else
        {
            if(s1.length() == 0)
            {
                m_response.setContentType("application/x-msdownload");
            }
            else
            {
                m_response.setContentType(s1);
            }
        }
        m_response.setContentLength((int)l);
        m_contentDisposition = m_contentDisposition != null ? m_contentDisposition : "attachment;";
        if(s2 == null)
        {
            m_response.setHeader("Content-Disposition",m_contentDisposition + " filename=" + getFileName(s));
        }
        else
	 */
	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
	 */
	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();
		String date=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime());
		try{
			String username2 = (String)session.getAttribute("user");
			 
				String method = request.getParameter("method").trim();
				if(method.equals("addNews")){
					String title = request.getParameter("title");
					String fenlei = request.getParameter("fenlei");
							else if(method.equals("DELALLUSE")){//来自所有在用会员页面
								request.getRequestDispatcher(sysdir+"/member/using.jsp").forward(request, response);
							}
						}
						else{
							if(method.equals("DELMEMBER")){//来自所有个人会员页面
								 request.getRequestDispatcher(sysdir+"/member/person.jsp").forward(request, response);
							}
							else if(method.equals("DELCO")){//来自所有企业会员页面
								 request.getRequestDispatcher(sysdir+"/member/co.jsp").forward(request, response);
							}
							else if(method.equals("DELTODAY")){//来自今日注册会员页面
								 request.getRequestDispatcher(sysdir+"/member/today.jsp").forward(request, response);
							}
							else if(method.equals("DELALLCLOSE")){//来自所有冻结会员页面
								 request.getRequestDispatcher(sysdir+"/member/close.jsp").forward(request, response);
							}
							else if(method.equals("DELALLUSE")){//来自所有在用会员页面
								 request.getRequestDispatcher(sysdir+"/member/using.jsp").forward(request, response);
							}
						}
					}
				}
				else if(method.equals("CLOSE")){
					String id=request.getParameter("id").trim();
					int flag=mmBean.closeMember(Integer.parseInt(id));
					if(flag==Constant.SUCCESS){
						request.setAttribute("message", "操作成功!");
						request.getRequestDispatcher("admin/member/person.jsp").forward(request, response);
					}
					else{
						request.setAttribute("message", "系统维护中,请稍后再试!");
						request.getRequestDispatcher("admin/member/person.jsp").forward(request, response);
					}
				}
				else{
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
			}
		}catch(Exception e){

public class NewsAction extends HttpServlet {

	private ServletConfig config;
	/**
	 * Constructor of the object.
	 */
	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.
	 * 

    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);
        long l = file.length();
        //boolean flag = false;
        int k = 0;
        byte abyte0[] = new byte[i];
        if(s1 == null)
        {
            m_response.setContentType("application/x-msdownload");
        }
							int s = Integer.parseInt(check[i]);				
							id[i] = s;
						}
						int flag = mmBean.delMember(id);
						if(flag == Constant.SUCCESS){
							if(method.equals("DELMEMBER")){//来自所有个人会员页面
								request.getRequestDispatcher(sysdir+"/member/person.jsp").forward(request, response);
							}
							else if(method.equals("DELCO")){//来自所有企业会员页面
								request.getRequestDispatcher(sysdir+"/member/co.jsp").forward(request, response);
							}
							else if(method.equals("DELTODAY")){//来自今日注册会员页面
								request.getRequestDispatcher(sysdir+"/member/today.jsp").forward(request, response);
							}
							else if(method.equals("DELALLCLOSE")){//来自所有冻结会员页面
								request.getRequestDispatcher(sysdir+"/member/close.jsp").forward(request, response);
							}
							else if(method.equals("DELALLUSE")){//来自所有在用会员页面
								request.getRequestDispatcher(sysdir+"/member/using.jsp").forward(request, response);
							}
						}
						else{
							if(method.equals("DELMEMBER")){//来自所有个人会员页面
								 request.getRequestDispatcher(sysdir+"/member/person.jsp").forward(request, response);
							}
							else if(method.equals("DELCO")){//来自所有企业会员页面
								 request.getRequestDispatcher(sysdir+"/member/co.jsp").forward(request, response);
							}
							else if(method.equals("DELTODAY")){//来自今日注册会员页面
								 request.getRequestDispatcher(sysdir+"/member/today.jsp").forward(request, response);
							}
							else if(method.equals("DELALLCLOSE")){//来自所有冻结会员页面
								 request.getRequestDispatcher(sysdir+"/member/close.jsp").forward(request, response);
							}
							else if(method.equals("DELALLUSE")){//来自所有在用会员页面
								 request.getRequestDispatcher(sysdir+"/member/using.jsp").forward(request, response);
							}
						}
					}
				}
				else if(method.equals("CLOSE")){
					String id=request.getParameter("id").trim();
					int flag=mmBean.closeMember(Integer.parseInt(id));
					if(flag==Constant.SUCCESS){
						request.setAttribute("message", "操作成功!");
    }

    public int getSize()
    {
        return m_totalBytes;
    }

    public byte getBinaryData(int i)
    {
        byte byte0;
        try
        {
            byte0 = m_binArray[i];
        }
        catch(Exception exception)
        {
            throw new ArrayIndexOutOfBoundsException("Index out of range (1005).");
        }
        return byte0;
    }

    public SmartFiles getFiles()
    {
        return m_files;
    }

    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
							else if(method.equals("DELALLCLOSE")){//来自所有冻结会员页面
								request.getRequestDispatcher(sysdir+"/member/close.jsp").forward(request, response);
							}
							else if(method.equals("DELALLUSE")){//来自所有在用会员页面
								request.getRequestDispatcher(sysdir+"/member/using.jsp").forward(request, response);
							}
						}
						else{
							if(method.equals("DELMEMBER")){//来自所有个人会员页面
								 request.getRequestDispatcher(sysdir+"/member/person.jsp").forward(request, response);
							}
							else if(method.equals("DELCO")){//来自所有企业会员页面
								 request.getRequestDispatcher(sysdir+"/member/co.jsp").forward(request, response);
							}
							else if(method.equals("DELTODAY")){//来自今日注册会员页面
								 request.getRequestDispatcher(sysdir+"/member/today.jsp").forward(request, response);
							}
							else if(method.equals("DELALLCLOSE")){//来自所有冻结会员页面
								 request.getRequestDispatcher(sysdir+"/member/close.jsp").forward(request, response);
							}
							else if(method.equals("DELALLUSE")){//来自所有在用会员页面
								 request.getRequestDispatcher(sysdir+"/member/using.jsp").forward(request, response);
							}
						}
					}
				}
				else if(method.equals("CLOSE")){
					String id=request.getParameter("id").trim();
					int flag=mmBean.closeMember(Integer.parseInt(id));
					if(flag==Constant.SUCCESS){
						request.setAttribute("message", "操作成功!");
						request.getRequestDispatcher("admin/member/person.jsp").forward(request, response);
					}
					else{
						request.setAttribute("message", "系统维护中,请稍后再试!");
						request.getRequestDispatcher("admin/member/person.jsp").forward(request, response);
					}
				}
				else{
					request.getRequestDispatcher("error.jsp").forward(request, response);
				}
			}
		}catch(Exception e){
			request.getRequestDispatcher("error.jsp").forward(request, response);
		}
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
package com.action;

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

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
	 */
        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);
        long l = file.length();
        //boolean flag = false;
        int k = 0;
        byte abyte0[] = new byte[i];
        if(s1 == null)
        {
            m_response.setContentType("application/x-msdownload");
        }
        else
        {
            if(s1.length() == 0)
            {
                m_response.setContentType("application/x-msdownload");
            }
            else
            {
                m_response.setContentType(s1);
            }
        }
        m_response.setContentLength((int)l);
        m_contentDisposition = m_contentDisposition != null ? m_contentDisposition : "attachment;";
        if(s2 == null)
        {
            m_response.setHeader("Content-Disposition",m_contentDisposition + " filename=" + getFileName(s));
	}

	/**
	 * 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
	 */
	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){
					if(reg_type.equals("person")){//如果是个人会员
						request.getRequestDispatcher("personreg.jsp").forward(request, response);
					}
					else if(reg_type.equals("co")){//如果是企业会员
						request.getRequestDispatcher("coreg.jsp").forward(request, response);
					}
					else{
						request.getRequestDispatcher("index.jsp").forward(request, response);
					}
				}
				else if(flag == Constant.SAME_NAME){
					request.setAttribute("username", username);
					request.setAttribute("message", "对不起,该用户名已存在,请重新选择!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
				else{
					request.setAttribute("message", "系统维护中,请稍后再试!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
			}
			
			
		}
		else if(method.equals("checksame")){//检查注册名是否可用
			String username = Filter.escapeHTMLTags(request.getParameter("username").trim());
			if(username.trim().equals("admin")){
				request.setAttribute("username", username);
				request.setAttribute("message", "非法的用户名,请重新选择!");
				request.getRequestDispatcher("reg2.jsp").forward(request, response);
			}
			else{
				int flag = memberBean.checkRegName(username);
				if(flag == Constant.SUCCESS){
					request.setAttribute("username", username);
					request.setAttribute("message", "恭喜您,这个名字可以使用!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
				else if(flag == Constant.SAME_NAME){
					request.setAttribute("username", username);
					request.setAttribute("message", "对不起,该用户名已存在,请重新选择!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
				else{
					request.setAttribute("message", "系统维护中,请稍后再试!");
					request.getRequestDispatcher("reg2.jsp").forward(request, response);
				}
            }
        }
        m_response.setContentLength((int)l);
        m_contentDisposition = m_contentDisposition != null ? m_contentDisposition : "attachment;";
        if(s2 == null)
        {
            m_response.setHeader("Content-Disposition",m_contentDisposition + " filename=" + getFileName(s));
        }
        else
        {
            if(s2.length() == 0)
            {
                m_response.setHeader("Content-Disposition",m_contentDisposition);
            }
            else
            {
                m_response.setHeader("Content-Disposition",m_contentDisposition + " filename=" + s2);
            }
        }
        while((long)k < l)
        {
            int j = fileinputstream.read(abyte0,0,i);
            k += j;
            m_response.getOutputStream().write(abyte0,0,j);
        }
        fileinputstream.close();
    }

    public void downloadField(ResultSet resultset,String s,String s1,String s2) throws ServletException,IOException,SQLException
    {
        if(resultset == null)
        {
            throw new IllegalArgumentException("The RecordSet cannot be null (1045).");
        }
        if(s == null)
        {
            throw new IllegalArgumentException("The columnName cannot be null (1050).");
        }
        if(s.length() == 0)
        {
				request.setAttribute("message", "系统维护中,请稍后再试!");
				return (mapping.findForward("admin/hzp/hot.jsp"));  
			}
		}
		else if(method.equals("tejiadeltrave")){
			String id=request.getParameter("id").trim();
			int flag = tb.delTrave(id);
			if(flag == Constant.SUCCESS){
				request.setAttribute("message", "操作成功!");
				return (mapping.findForward("admin/hzp/tejia.jsp"));  
			}
			else{
				request.setAttribute("message", "系统维护中,请稍后再试!");
				return (mapping.findForward("admin/hzp/tejia.jsp"));  
			}
		}
		else if(method.equals("tuijiandeltrave")){
			String id=request.getParameter("id").trim();
			int flag = tb.delTrave(id);
			if(flag == Constant.SUCCESS){
				request.setAttribute("message", "操作成功!");
				return (mapping.findForward("admin/hzp/tuijian.jsp"));   
			}
			else{
				request.setAttribute("message", "系统维护中,请稍后再试!");
				return (mapping.findForward("admin/hzp/tuijian.jsp"));   
			}
		}
		 
		else if(method.equals("addType")){
			String type=request.getParameter("type").trim();
			int flag=tb.addType(type);
			if(flag == Constant.SUCCESS){
				request.setAttribute("message", "操作成功!");
				return (mapping.findForward("admin/hzp/type.jsp"));   
			}
			else if(flag==Constant.DEFAULT_ERROR){
				request.setAttribute("message", "该分类已存在!");
				return (mapping.findForward("admin/hzp/type.jsp"));   
			}
			else{
				request.setAttribute("message", "系统维护中,请稍后再试!");
				return (mapping.findForward("admin/hzp/type.jsp"));   
			}
		}
		else if(method.equals("delType")){
			String id=request.getParameter("id").trim();
			int flag=tb.delType(id);
			if(flag == Constant.SUCCESS){
				request.setAttribute("message", "操作成功!");
				return (mapping.findForward("admin/hzp/type.jsp"));   
			}
	/**
	 * 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
	 */
	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{
				String method = request.getParameter("method").trim();
				
				/**********************************************
				 * 新闻
				 ************************************************/
				if(method.equals("DELNEWS")){//删除新闻 来自普通新闻页面index.jsp
					String strDirPath = request.getSession().getServletContext().getRealPath("/");
					String check[] = request.getParameterValues("checkit");
        			if(check == null){
	 * @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);
		HttpSession session = request.getSession();
		MemberBean memberBean = new MemberBean();
		String method = Filter.escapeHTMLTags(request.getParameter("method").trim());
		/*********************************************
		 * 会员注册通用(检查用户名 修改密码 reg2.jsp页面跳转)
		 *********************************************/
		if(method.equals("reg2")){//会员注册 reg2.jsp
			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());
			request.setAttribute("username", username);
			request.setAttribute("password", password);
			request.setAttribute("reg_type", reg_type);
			if(username.trim().equals("admin")){
				request.setAttribute("username", username);
				request.setAttribute("message", "非法的用户名,请重新选择!");
				request.getRequestDispatcher("reg2.jsp").forward(request, response);
			}
			else{
				int flag = memberBean.checkRegName(username);
				if(flag == Constant.SUCCESS){
					if(reg_type.equals("person")){//如果是个人会员
						request.getRequestDispatcher("personreg.jsp").forward(request, response);
					}
					else if(reg_type.equals("co")){//如果是企业会员
						request.getRequestDispatcher("coreg.jsp").forward(request, response);
					}
					else{
						request.getRequestDispatcher("index.jsp").forward(request, response);
					}
 */

public class AfficheAction extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public AfficheAction() {
		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 {

		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
        {
            flag = true;
        }
        if(i == 0)
        {
            if(isVirtual(s1))
            {
                s1 = m_application.getRealPath(s1);
                if(s1.endsWith(s3))
                {
                    s1 = s1 + s2;
                }
                else
                {
                    s1 = s1 + s3 + s2;
                }
                return s1;
            }
            if(flag)
            {
                if(m_denyPhysicalPath)
                {
                    throw new IllegalArgumentException("Physical path is denied (1125).");
                }
                else
                {
                    return s;
                }
            }
            else
            {
                throw new IllegalArgumentException("This path does not exist (1135).");
            }
        }
        if(i == 1)
        {
            if(isVirtual(s1))
            {
                s1 = m_application.getRealPath(s1);
                if(s1.endsWith(s3))
                {
                    s1 = s1 + s2;
                }
                else
                {
                    s1 = s1 + s3 + s2;
                }
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
package com.action;

/**
 * 会员注册、修改资料等
 *
 */

public class MemberAction extends HttpServlet {

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

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

	/**
	/**
	 * Constructor of the object.
	 */
	public CommonAction() {
		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 {

		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 {

        byte abyte0[] = resultset.getBytes(s);
        if(s1 == null)
        {
            m_response.setContentType("application/x-msdownload");
        }
        else
        {
            if(s1.length() == 0)
            {
                m_response.setContentType("application/x-msdownload");
            }
            else
            {
                m_response.setContentType(s1);
            }
        }
        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);
            }
        			if(check == null){
						request.setAttribute("message", "请选择要删除的记录!");
						request.getRequestDispatcher(sysdir+"/news/index.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); 
						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);
						}
					}
				}
				else if(method.equals("HIDENEWS")){//隐藏、显示新闻 来自普通新闻页面index.jsp
					String id = Filter.escapeHTMLTags(request.getParameter("id").trim());
					int flag = new NewsBean().hideNews(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);
					}
				}
				else if(method.equals("UPNEWS")){//置顶 新闻 来自普通新闻页面index.jsp
					String id = Filter.escapeHTMLTags(request.getParameter("id").trim());
					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;
        //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];

            }
        }
        if(m_currentIndex == 1)
        {
            return;
        }
        for(m_currentIndex++;m_currentIndex < m_totalBytes;m_currentIndex = m_currentIndex + 2)
        {
        	long now=new java.util.Date().getTime();
            String s1 = getDataHeader();
            m_currentIndex = m_currentIndex + 2;
            boolean flag3 = s1.indexOf("filename") > 0;
            String s3 = getDataFieldValue(s1,"name");
            if(flag3)
            {
	}

	/**
	 * 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
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType(Constant.CONTENTTYPE);
		request.setCharacterEncoding(Constant.CHARACTERENCODING);
		String sysdir = new SystemBean().getDir();
	 * 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 {

		request.setCharacterEncoding(Constant.CHARACTERENCODING);
		response.setContentType(Constant.CONTENTTYPE);
		HttpSession session=request.getSession();
		HzpBean tb=new HzpBean();
		String method=request.getParameter("method").trim();
		/ 
		if(method.equals("deltrave")){
			String id=request.getParameter("id").trim();
			int flag = tb.delTrave(id);
			if(flag == Constant.SUCCESS){
				request.setAttribute("message", "操作成功!");
				request.getRequestDispatcher("admin/hzp/index.jsp").forward(request, response);
			}
			else{
				request.setAttribute("message", "系统维护中,请稍后再试!");
				request.getRequestDispatcher("admin/hzp/index.jsp").forward(request, response);
			}
		}

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

目前,我国旅游业信息化管理的进程缓慢,跟国外的城市相比管理依然落后。这就 需要提供最好的服务,提供最完善的设施和最先进的管理。在信息时代,更重要的是还 必须要有一个完善的信息宣传系统,便于方便客人以及更好地宣传城市。特别是近年来 计算机和网络技术和应用在我国突飞猛进的发展, 越来越多的行业都涉足到这个新兴的 领域,而城市宣传由于自身应该和游客及时快捷紧密联系的特点,更应该乘着这股春风 打开城市管理新的一页, 更为城市管理与国际接轨以及城市的长足发展打下良好的软件 基础。旅游线路管理系统设计与开发,它可以借用计算机信息化的优势,方便快捷的实 现游客和管理者的交户,方便管理者在第一时间了解游客的需求,及时做好应对措施, 从而可以使旅游风景区在竞争日益激烈的城市服务行业中取得优势。 科学技术日新月异的进步,让人类生活发生了巨大的变化,计算机网络技术的飞速 发展,使各行各业在计算机网络技术应用方面得到了广泛的普及和使用。信息化时代的 到来成为不可抗拒的潮流,人类文明正在进入一个崭新的时代。因此,旅游线路管理系 统设计与开发也以方便、快捷、费用低的优点正慢慢地进入人们的生活,将传统的城市 旅游宣传方式彻底的解脱出来,提高效率,减轻工人人员以往繁忙的工作,提高宣传效 果,使工作人员可以花更多的时间在选择如何提高服务质量上。从而使旅游从业人员有 更多时间来获取信息、了解信息、掌握信息。 面对激烈的市场竞争和纷繁复杂的业务需求,现代旅游业的宣传必须通过城市网络 宣传系统的帮助,来完成日常管理,特殊服务等各项业务。引入城市网络宣传系统,对 旅游风景区的旅游业务进行科学化、现代化的宣传,是提高城市旅游形象、档次和服务 水准的有力表现方式。为城市旅游强化内部管理、提高服务质量,减少工作中的差错, 防止跑单漏单提供了可靠的技术手段和技术保障 . 为了能让宣传人员从繁重的工作中解脱出来, 使宣传人员在使用一个系统以后能极 其容易地对所有旅游资源进行宣传,并且准确无误,轻松自如。因此开发一个旅游线路 管理系统设计与开发是当务之急,也是本论文选题的重要意义和研究宗旨。 关键字 : 信息宣传 ,JSP,,数据库, 计算机网络应用
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值