import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
public class Comfirm extends HttpServlet {
private static final long serialVersionUID = -3983093134005309850L;
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
response.setCharacterEncoding("GB2312");
PrintWriter out = response.getWriter();
request.setCharacterEncoding("GB2312");
String right,username,password;
right=request.getParameter("right");
username=request.getParameter("username");
password=request.getParameter("password");
OperateDb check=new OperateDb();
String sql;
sql="select sname,scode from "+right;
ResultSet rs=check.query(sql);
try {
while(rs.next()){
String name,pass;
name=rs.getString(1);
pass=rs.getString(2);
if(name.equals(username)&&pass.equals(password))
{
String pageName;
pageName="//"+right+".jsp";
gotoPage(pageName,request,response);
return;
//RequestDispatcher d=getServletContext().getRequestDispatcher(pageName);
//d.forward(request, response);
}
}
gotoPage("/error.jsp",request,response);
return;
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
out.flush();
out.close(); }
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request,response);
}
public void gotoPage(String pageName,HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException{
RequestDispatcher d=getServletContext().getRequestDispatcher(pageName);
d.forward(request, response);
}
}
(3)、管理员模块:
1、管理员主界面:此页面对应admin.jsp页面。在此页面左下方菜单栏的账号管理对应上面的管理员系统设置模块图;管理操作中包括上面的车票信息管理模块图及订票管理模块图。
上一页 [1] [2] [3] [4] [5] [6] 下一页