资源简介

代码写得很垃圾,只用了2天。但购物车,后台管理等功能都全。 数据库用MYSQL,工具是MYECLIPSE! 但是拿来做课程设计已经足以。还拿了个优。哈哈......

资源截图

代码片段和文件信息

package com.bitzh.hotel.admin;

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 javax.servlet.http.HttpSession;

public class AdminLoginServlet extends HttpServlet {

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

response.setContentType(“text/html“);
PrintWriter out = response.getWriter();
out
.println(““);
out.println(““);
out.println(“  tle>A Servlettle>“);
out.println(“  “);
out.print(“    This is “);
out.print(this.getClass());
out.println(“ using the GET method“);
out.println(“  “);
out.println(““);
out.flush();
out.close();
}

/**
 * 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(“text/html“);
request.setCharacterEncoding(“utf-8“);
String username=request.getParameter(“username“);
String password=request.getParameter(“password“);
if(username.equals(“admin“)||password.equals(“admin“)){
HttpSession session = request.getSession();
session.setAttribute(“adminname“ username);
response.sendRedirect(“adminIndex.jsp“);
}
else{
response.sendRedirect(“index.jsp“);
}
}

/**
 * Initialization of the servlet. 

 *
 * @throws ServletException if an error occurs
 */
public void init() throws ServletException {
// Put your code here
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        811  2009-06-29 00:36  cms\.classpath

     文件        282  2009-06-24 21:34  cms\.mymetadata

     文件       1409  2009-06-20 01:14  cms\.project

     文件        500  2009-06-20 01:12  cms\.settings\.jsdtscope

     文件        141  2009-06-27 22:34  cms\.settings\com.genuitec.eclipse.core.prefs

     文件         88  2009-06-20 01:14  cms\.settings\org.eclipse.core.resources.prefs

     文件        629  2009-06-20 01:14  cms\.settings\org.eclipse.jdt.core.prefs

     文件         49  2009-06-20 01:12  cms\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2009-06-20 01:12  cms\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件      33602  2009-06-29 11:48  cms\cms.umr

     文件       1133  2009-06-29 11:48  cms\cms.umr~

     文件       2749  2009-06-25 21:27  cms\src\com\bitzh\hotel\admin\AdminLoginServlet.java

     文件       2324  2009-06-27 18:13  cms\src\com\bitzh\hotel\admin\DealWithBookingServlet.java

     文件       1546  2009-06-24 22:08  cms\src\com\bitzh\hotel\cart\AddGoodsServlet.java

     文件       1328  2009-06-24 21:35  cms\src\com\bitzh\hotel\cart\CartGoodsInf.java

     文件       1964  2009-06-27 19:17  cms\src\com\bitzh\hotel\cart\CartUnit.java

     文件       2200  2009-06-24 21:35  cms\src\com\bitzh\hotel\cart\ChangeAmountServlet.java

     文件       1244  2009-06-24 22:04  cms\src\com\bitzh\hotel\cart\ClearShoppingCartServlet.java

     文件       1079  2009-06-24 21:35  cms\src\com\bitzh\hotel\cart\DeleteGoodsServlet.java

     文件       3651  2009-06-29 01:40  cms\src\com\bitzh\hotel\cart\PayGoodsServlet.java

     文件       1917  2009-06-24 21:35  cms\src\com\bitzh\hotel\cart\ShoppingCart.java

     文件       1261  2009-06-24 22:05  cms\src\com\bitzh\hotel\cart\ViewShoppingCartServlet.java

     文件       2326  2009-06-29 11:37  cms\src\com\bitzh\hotel\db\Database.java

     文件       3200  2009-06-24 16:00  cms\src\com\bitzh\hotel\message\AddHotelServlet.java

     文件       1972  2009-06-25 15:19  cms\src\com\bitzh\hotel\message\Hotel.java

     文件       2824  2009-06-25 15:33  cms\src\com\bitzh\hotel\message\HotelMessageServlet.java

     文件       2859  2009-06-23 21:36  cms\src\com\bitzh\hotel\user\LoginServlet.java

     文件      12463  2009-06-29 13:52  cms\src\com\bitzh\hotel\user\Md5.java

     文件       2631  2009-06-23 19:31  cms\src\com\bitzh\hotel\user\RegisterServlet.java

     文件       2647  2009-06-23 22:57  cms\src\com\bitzh\hotel\user\UpdataUserServlet.java

............此处省略142个文件信息

评论

共有 条评论