?? checkid.java
字號:
package Ajax;
import DAO.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class CheckId extends HttpServlet{
public void init(ServletConfig config) throws ServletException{
super.init(config);
}//改改doGet
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
response.setContentType("text/html;charset=gb2312");
String yourId=request.getParameter("id");
System.out.println("yourId="+yourId);
DAO dao=new DAO();
int a=0;
if(dao.checkId(yourId)){
a=1;
}else if(!yourId.matches("[a-zA-Z0-9]{1,10}")){
a=2;
}else{
a=3;
}
response.getWriter().print(a);
}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{
doGet(request,response);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -