?? login.java
字號:
package org.baobao.servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.baobao.dao.dbStu;
public class Login extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
{
request.setCharacterEncoding("GB2312");
String userName = request.getParameter("userName");
String str_userPwd = request.getParameter("userPwd");
HttpSession session = request.getSession();
int userPwd = Integer.parseInt(str_userPwd);
if (new dbStu().queryUser(userName,userPwd))
{
session.setAttribute("userName",userName);
response.sendRedirect("/Demo01/Show.jsp");
}else
{
response.sendRedirect("/Demo01/Login.jsp?error="+userName+" "+userPwd);
}
}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
{
doGet(request,response);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -