作者主页:源码空间站2022

简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

本项目为前后台,包括管理员与普通用户两种角色;

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

管理员登录,用户管理,会员管理,民宿信息管理,新闻管理,留言管理等功能。

用户角色包含以下功能:
用户登录与注册,查看网站新闻,查看民宿信息,查看留言板,修改个人信息,提交订单,查看我的订单等功能。

环境需要

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项目:否;

技术栈

JSP+CSS+JavaScript+mysql+servlet

使用说明

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

管理员账号/密码:admin/admin

运行截图

用户角色

管理员角色

相关代码

YudingJiuAction

package com.biyeseng.action;import java.io.IOException;
import java.io.PrintWriter;import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import com.biyeseng.db.DBManager;
import java.sql.*;
import java.util.Date;/*** 修改新闻* * @author win7* */
public class YudingJiuAction extends HttpServlet {/*** Constructor of the object.*/public YudingJiuAction() {super();}/*** Destruction of the servlet. <br>*/public void destroy() {super.destroy(); // Just puts "destroy" string in log// Put your code here}/*** 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("text/html");PrintWriter out = response.getWriter();String name=request.getParameter("name");String fang=request.getParameter("fang");String count=request.getParameter("count");String bdate=request.getParameter("bdate");String edate=request.getParameter("edate");String tel=request.getParameter("tel");String fangkuan=request.getParameter("fangkuan");String dingjin=request.getParameter("dingjin");String ism=request.getParameter("ism");String mtel=request.getParameter("mtel");String sql = "insert into yuding(name,fang,count,bdate,edate,tel,fangkuan,dingjin,ism,mtel) values('"+name+"','"+fang+"','"+count+"','"+bdate+"','"+edate+"','"+tel+"','"+fangkuan+"','"+dingjin+"','"+ism+"','"+mtel+"')";System.out.println(sql);Statement stat = null;Connection conn = null;DBManager dbm = new DBManager();try {conn = dbm.getConnection();stat = conn.createStatement();stat.execute(sql);} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();} finally {try {if (stat != null)stat.close();if (conn != null)conn.close();} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}}out.println("<script>alert('预订民宿成功,客服人员会尽快和您联系谢谢!');window.location.href='jiudian.jsp'</script>");out.flush();out.close();}public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {this.doPost(request, response);}/*** Initialization of the servlet. <br>* * @throws ServletException*             if an error occurs*/public void init() throws ServletException {// Put your code here}}

AddAdminAction

package com.biyeseng.action;import java.io.IOException;
import java.io.PrintWriter;
import java.sql.*;import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import com.biyeseng.db.DBManager;/*** 添加管理员* @author win7**/
public class AddAdminAction extends HttpServlet {/*** Constructor of the object.*/public AddAdminAction() {super();}/*** Destruction of the servlet. <br>*/public void destroy() {super.destroy(); // Just puts "destroy" string in log// Put your code here}/*** 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("text/html");PrintWriter out = response.getWriter();String name=request.getParameter("name");String pwd=request.getParameter("pwd");String zhi=request.getParameter("zhi");String tel=request.getParameter("tel");String age=request.getParameter("age");DBManager dbm = new DBManager();//插入管理员信息表String sql = "insert into admin(userName,userPw,zhi,tel,age)  values('"+name+"','"+pwd+"','"+zhi+"','"+tel+"','"+age+"')";Statement stat = null;Connection conn=null;try {conn=dbm.getConnection();stat = conn.createStatement();System.out.println(sql);stat.execute(sql);} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();} finally {try {if(stat!=null)stat.close();if(conn!=null)conn.close();} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}}response.sendRedirect("admin/admin/list.jsp");out.flush();out.close();}/*** Initialization of the servlet. <br>** @throws ServletException if an error occurs*/public void init() throws ServletException {// Put your code here}}

AddJiudianAction

package com.biyeseng.action;import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Date;
import java.util.Iterator;
import java.util.List;import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import org.apache.commons.fileupload.DiskFileUpload;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;import com.biyeseng.db.DBManager;public class AddJiudianAction extends HttpServlet {/*** Constructor of the object.*/public AddJiudianAction() {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 {this.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("UTF-8");response.setContentType("text/html");PrintWriter out = response.getWriter();DBManager dbm = new DBManager();String name=request.getParameter("name");String dizhi=request.getParameter("dizhi");String info=request.getParameter("info");String pic=request.getParameter("fujian");String tel=request.getParameter("tel");String style=request.getParameter("style");String date = new Date().toLocaleString();Object user = request.getSession().getAttribute("user");String appuser = "";if (user != null && appuser.toString() != null) {appuser = (String) user;}if(pic != null) {pic = pic.replaceAll("/upload", "upload");}String sql = "insert into jiudian(name,dizhi,info,pic,tel,style) values('"+name+"','"+dizhi+"','"+info+"','"+pic+"','"+tel+"','"+style+"')";Statement stat = null;Connection conn = null;try {conn = dbm.getConnection();stat = conn.createStatement();System.out.println(sql);stat.execute(sql);} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();} finally {try {if (stat != null)stat.close();if (conn != null)conn.close();} catch (SQLException e) {// TODO Auto-generated catch blocke.printStackTrace();}}response.sendRedirect("admin/jiudian/list.jsp");out.flush();out.close();}/*** Initialization of the servlet. <br>** @throws ServletException if an error occurs*/public void init() throws ServletException {// Put your code here}}

AddKefangAction

package com.biyeseng.action; import java.io.IOException;
import java.io.PrintWriter;
import java.sql.*;  import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;  import com.biyeseng.db.DBManager;   /** * 添加部门  * @author win7 *   */
public class AddKefangAction extends HttpServlet {  /** * Constructor of the object.    */  public AddKefangAction() {  super();    }   /** * Destruction of the servlet. <br>    */  public void destroy() { super.destroy(); // Just puts "destroy" string in log // Put your code here   }   /** * 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("text/html"); PrintWriter out = response.getWriter();    String jid=request.getParameter("jid");String name=request.getParameter("name");String chuang=request.getParameter("chuang");String ren=request.getParameter("ren");String price=request.getParameter("price");String type=request.getParameter("type");String state="";DBManager dbm = new DBManager();  String sql = "insert into kefang(jid,name,chuang,ren,price,type,state) values("+jid+",'"+name+"','"+chuang+"','"+ren+"','"+price+"','"+type+"','"+state+"')";    System.out.println(sql);    Statement stat = null; Connection conn=null;  try {   conn=dbm.getConnection();  stat = conn.createStatement(); stat.execute(sql);  } catch (SQLException e) {  // TODO Auto-generated catch block  e.printStackTrace();    } finally { try {   if(stat!=null) stat.close();   if(conn!=null) conn.close();   } catch (SQLException e) {  // TODO Auto-generated catch block  e.printStackTrace();    }   }   response.sendRedirect("admin/kefang/list.jsp?jid="+jid);    out.flush();    out.close();    }   /** * Initialization of the servlet. <br> *   * @throws ServletException if an error occurs  */  public void init() throws ServletException {    // Put your code here   }   }

如果也想学习本系统,下面领取。关注并回复:066jsp

Java项目:JSP民宿预订网站信息管理平台相关推荐

  1. 基于SSM+JSP实现的民宿预订网站(用户管理、房源管理、注册登录、民宿预定、订单管理、订单删除等)

    博客目录 基于SSM+JSP实现的民宿预订网站 实现功能截图 系统功能 使用技术 完整源码 基于SSM+JSP实现的民宿预订网站 本系统是SSM的民宿管理系统,可以实现用户管理.房源管理.用户注册登录 ...

  2. java计算机毕业设计民宿预订管理系统设计与实现源码+数据库+系统+lw文档+mybatis+运行部署

    java计算机毕业设计民宿预订管理系统设计与实现源码+数据库+系统+lw文档+mybatis+运行部署 java计算机毕业设计民宿预订管理系统设计与实现源码+数据库+系统+lw文档+mybatis+运 ...

  3. java计算机毕业设计民宿运营管理网站MyBatis+系统+LW文档+源码+调试部署

    java计算机毕业设计民宿运营管理网站MyBatis+系统+LW文档+源码+调试部署 java计算机毕业设计民宿运营管理网站MyBatis+系统+LW文档+源码+调试部署 本源码技术栈: 项目架构:B ...

  4. java计算机毕业设计民宿预订管理系统设计与实现源程序+mysql+系统+lw文档+远程调试

    java计算机毕业设计民宿预订管理系统设计与实现源程序+mysql+系统+lw文档+远程调试 java计算机毕业设计民宿预订管理系统设计与实现源程序+mysql+系统+lw文档+远程调试 本源码技术栈 ...

  5. 基于ssm的民宿预订网站的设计与实现

    采用ssm框架平台设计建设一款民宿预订网站.网站可以为房主提供一个在线发布客房信息的平台,同时也为游客提供一个在出行前可以预订住宿,查看旅游信息的网站.根据对民宿预订客房服务的调研,需要实现以下功能: ...

  6. java计算机毕业设计民宿运营管理网站源码+系统+mysql数据库+lw文档+部署

    java计算机毕业设计民宿运营管理网站源码+系统+mysql数据库+lw文档+部署 java计算机毕业设计民宿运营管理网站源码+系统+mysql数据库+lw文档+部署 本源码技术栈: 项目架构:B/S ...

  7. java计算机毕业设计民宿运营管理网站(附源码、数据库)

    java计算机毕业设计民宿运营管理网站(附源码.数据库) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe( ...

  8. JAVA毕设项目民宿运营管理网站(Vue+Mybatis+Maven+Mysql+sprnig+SpringMVC)

    JAVA毕设项目民宿运营管理网站(Vue+Mybatis+Maven+Mysql+sprnig+SpringMVC) 项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + H ...

  9. 基于idea-SSM的民宿预约网站客房预订管理系统-客户预订(javaweb-php-asp.netC#-j2ee-springboot)

    0.效果展示 1.概述 本系统是基于B/S模式设计和开发的一个的民宿网站系统[2],系统主要对民宿的一些理念.本系统要求实现以下功能: 1)登录:用户进入网站后可以注册会员,注册成功后输入用户名和密码 ...

最新文章

  1. ajax从mysql提取数据在html中_EXCEL混合内容中提取数据,其实很简单
  2. DIV CSS完美兼容IE6/IE7/FF的通用方法
  3. linux中文件描述符fd和文件指针flip的理解
  4. Spring Boot的各种漏洞,值得好好研究一番!
  5. CSS设置超出表格的内容用省略号显示
  6. python中访问命令行参数_如何在Python中访问命令行参数?
  7. JAVA——构建FAT32文件系统的DBR(DOS引导记录)类
  8. 【系统架构设计师】2020-08-05
  9. oracle ora-22288,向oracle的blob字段导入文件
  10. cd返回上一 git_使用Git实现自动化部署项目
  11. [技术收藏]关于IOPS
  12. java 常用类 练习_Java常用类之String类练习
  13. javamail发送邮件,解决被垃圾邮件问题
  14. 如何把linux 安装到u盘,利用U盘装CentOS 6.4和将CentOS 6.4安装到U盘
  15. 武汉市电子信息职业技术学校现代电子电工高水平实训基地
  16. layui框架实战案例(9):layPage 静态数据分页组件
  17. 开源边缘计算平台研究分析
  18. Error: No EPCS layout data - looking for section [EPCS-C84018]
  19. 2018及过去20年诺贝尔化学奖获奖者及其贡献!
  20. 关于Java平台无关性你该知道这些

热门文章

  1. 软件工程——结构化设计
  2. 直播系统源码App中Android酷炫礼物动画直播平台源码搭建教程(上篇)
  3. 利用Node.js 超快下载视频
  4. win10 conda安装labme安装和使用
  5. 创立十周年,销售易发力新战场
  6. javaweb html和css基础知识
  7. 【北医三院】生孩、出院等事宜
  8. 高光谱异常探测研究背景与意义
  9. linux环境下用jmeter 5.4.3进行性能测试
  10. php 单页应用,有关单页应用的体验问题