資源簡介
基于JSP的酒店管理系統,可以用于本科階段學習和答辯
后臺管理
登錄
注銷
用戶管理
員工管理
房間管理
開房/退房管理
權限管理
用戶界面
登錄
注冊
首頁
客房查看
客房商品
退訂房管理
留言
個人信息
技術介紹
開發語言:Java
開發工具:eclipse
數據庫:MySQL

代碼片段和文件信息
package?com.action;
/**
?*?管理員登陸?增加?修改?刪除??
?*/
import?java.io.IOException;
import?java.text.SimpleDateFormat;
import?java.util.Calendar;
import?java.util.List;
import?java.util.StringTokenizer;
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.ComBean;?
import?com.util.Constant;?
public?class?AdminServlet?extends?HttpServlet?{
/**
?*?Constructor?of?the?object.
?*/
public?AdminServlet()?{
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);
String?date=new?SimpleDateFormat(“yyyy-MM-dd?HH:mm:ss“).format(Calendar.getInstance().getTime());
String?date2=new?SimpleDateFormat(“yyyy-MM-dd“).format(Calendar.getInstance().getTime());
try{
String?method=request.getParameter(“method“).trim();
ComBean?cBean?=?new?ComBean();
HttpSession?session?=?request.getSession();???
if(method.equals(“one“)){//用戶登錄
String?username?=?request.getParameter(“username“);
String?password?=?request.getParameter(“password“);???
String?str=cBean.getString(“select?realname?from?admin?where?username=‘“+username+“‘?and??password=‘“+password+“‘?“);
if(str==null){
request.setAttribute(“message“?“登錄信息錯誤!“);
request.getRequestDispatcher(“login2.jsp“).forward(request?response);?
}
else{
session.setAttribute(“user“?username);???
request.getRequestDispatcher(“admin/index.jsp“).forward(request?response);?
}??
}
else?if(method.equals(“uppwd“)){//修改密碼
String?username=(String)session.getAttribute(“user“);?
String?oldpwd?=?request.
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2020-05-02?09:16??jdgl\
?????文件????????1529??2017-12-18?20:04??jdgl\.classpath
?????目錄???????????0??2020-04-06?16:52??jdgl\.myeclipse\
?????文件?????????285??2018-04-28?16:11??jdgl\.myme
?????文件????????1410??2017-12-18?20:07??jdgl\.project
?????目錄???????????0??2020-04-06?16:51??jdgl\.settings\
?????文件?????????500??2017-12-18?19:55??jdgl\.settings\.jsdtscope
?????文件?????????330??2017-12-18?19:55??jdgl\.settings\org.eclipse.jdt.core.prefs
?????文件??????????49??2017-12-18?19:55??jdgl\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2017-12-18?19:55??jdgl\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件????????7749??2018-04-16?21:10??jdgl\db.sql
?????目錄???????????0??2020-04-06?16:51??jdgl\src\
?????目錄???????????0??2020-04-06?16:51??jdgl\src\com\
?????目錄???????????0??2020-04-06?16:51??jdgl\src\com\action\
?????文件????????7276??2017-12-18?20:18??jdgl\src\com\action\AdminServlet.java
?????文件???????17735??2018-04-28?16:24??jdgl\src\com\action\ComServlet.java
?????文件????????8416??2017-12-18?20:23??jdgl\src\com\action\MemberServlet.java
?????文件????????6201??2017-12-18?20:04??jdgl\src\com\action\UpServlet.java
?????目錄???????????0??2020-04-06?16:51??jdgl\src\com\bean\
?????文件????????4310??2017-12-18?20:04??jdgl\src\com\bean\ComBean.java
?????目錄???????????0??2020-04-06?16:51??jdgl\src\com\util\
?????文件????????1838??2017-12-18?20:04??jdgl\src\com\util\Common.java
?????文件?????????533??2017-12-18?20:04??jdgl\src\com\util\Constant.java
?????文件????????2480??2017-12-18?20:08??jdgl\src\com\util\DBO.java
?????文件?????????650??2017-12-18?20:04??jdgl\src\com\util\Filter.java
?????目錄???????????0??2020-04-06?16:51??jdgl\WebRoot\
?????目錄???????????0??2020-04-06?16:51??jdgl\WebRoot\admin\
?????目錄???????????0??2020-04-06?16:51??jdgl\WebRoot\admin\dd\
?????文件????????7609??2017-12-18?20:04??jdgl\WebRoot\admin\dd\index.jsp
?????文件????????2288??2017-12-18?20:04??jdgl\WebRoot\admin\dd\s.jsp
?????文件????????4121??2017-12-18?20:04??jdgl\WebRoot\admin\dd\sh.jsp
............此處省略523個文件信息
- 上一篇:JAVA核心面試知識整理.pdf
- 下一篇:java對PDF簽名簽章demo
評論
共有 條評論