package com.servlet;
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 com.link.chaxun;
import com.link.link;
public class login extends HttpServlet {
/**
* Constructor of the object.
*/
public login() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* 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");
request.setCharacterEncoding("utf-8");
response.setCharacterEncoding("utf-8");
PrintWriter out = response.getWriter();
String userName = request.getParameter("UserName");
// request.getSession().setAttribute("userName", userName);
// 密码
String pass = request.getParameter("Password");
// request.getSession().setAttribute("pass", pass);
chaxun dl = new chaxun();
//dl.insertInto(userName, pass);
if(dl.search(userName, pass)){
System.out.println("relly");
request.getRequestDispatcher("leaveword.jsp").forward(request,response);
}
else{
System.out.println("No");
request.getRequestDispatcher("error.jsp").forward(request,response);
}
out.flush();
out.close();
}
/**
* The doPost method of the servlet. <br>
*
* 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 {
this.doGet(request, response);
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occure
*/
public void init() throws ServletException {
// Put your code here
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
基于java的个人网站管理系统 (221个子文件)
register.class 2KB
login.class 2KB
userregister.class 1KB
link.class 1KB
chaxun.class 1KB
.classpath 609B
style.css 2KB
style.css 212B
01.cur 3KB
02.cur 2KB
4baf765929fc492b2934f03c.gif 357KB
t.gif 357KB
1_10.gif 45KB
SP_A0138_副本.gif 40KB
logo.gif 27KB
bg.gif 19KB
A_AltMenubg.gif 9KB
rjbj.gif 9KB
xinxi.gif 8KB
foot.gif 7KB
gbbj.gif 6KB
shejibj.gif 6KB
listgif.gif 4KB
sds.gif 4KB
logo.gif 4KB
sp.gif 3KB
zhuanti4.gif 3KB
zhuanti3.gif 3KB
fuwu1.gif 3KB
zhuanti6.gif 3KB
fuwu2.gif 3KB
fuwu3.gif 3KB
zhuanti5.gif 3KB
fuwu4.gif 3KB
zzlogo.gif 3KB
0003.gif 3KB
zhuanti1.gif 3KB
bj8.gif 3KB
复件 fuwu11.gif 3KB
zhuanti2.gif 3KB
rjtop.gif 2KB
zxxico.gif 2KB
img.gif 2KB
lanmu8.gif 2KB
bj7.gif 2KB
lanmu5.gif 1KB
img1.gif 1KB
lanmu7.gif 1KB
about44.gif 1KB
xuyuan3.gif 1KB
menu5.gif 1KB
menu9.gif 1KB
a.gif 1KB
d.gif 1KB
top4.gif 1KB
online1.gif 1KB
e.gif 1KB
b.gif 1KB
c.gif 1KB
readmore.gif 1013B
top3.gif 981B
about33.gif 960B
about22.gif 937B
bj.gif 922B
square_006.gif 858B
bbs-a14.gif 858B
dh_02.gif 669B
topback.gif 547B
bj4.gif 508B
pb.gif 385B
ptitc.gif 340B
top5.gif 299B
daohang5.gif 290B
lanmu6.gif 251B
bj3.gif 250B
lanmu9.gif 248B
count1.gif 246B
lanmu3.gif 244B
weizhi.gif 243B
lanmu4.gif 241B
lanmu1.gif 241B
lanmu2.gif 240B
fenlei.gif 238B
daohang.gif 237B
lanmu10.gif 236B
more.gif 222B
xiangguan.gif 217B
menu1.gif 197B
menu5.gif 197B
foot.gif 197B
topback.gif 197B
menu8.gif 197B
menu9.gif 197B
online.gif 197B
menu2.gif 197B
menu4.gif 197B
menu0.gif 197B
menu3.gif 197B
menu7.gif 197B
top.gif 197B
共 221 条
- 1
- 2
- 3
资源评论
xingvskong11
- 粉丝: 21
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功