package tiaomao.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import tianmao.dao.UserDao;
/**
* Servlet implementation class RegisteServlet
*/
@WebServlet("/RegisteServlet")
public class RegisteServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public RegisteServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//response.getWriter().append("Served at: ").append(request.getContextPath());
request.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
String username = request.getParameter("username");
String password = request.getParameter("password");
String isPassword = request.getParameter("isPassword");
//System.out.println(username + "," + password +","+ isPassword);
if(username == null || username.trim().isEmpty()) {
request.setAttribute("msg", "用户名不能为空");
request.getRequestDispatcher("/registe.jsp").forward(request, response);
return;
}
if(password == null || password.trim().isEmpty()) {
request.setAttribute("msg", "密码不能为空");
request.getRequestDispatcher("/registe.jsp").forward(request, response);
return;
}
if(!password.equals(isPassword)) {
request.setAttribute("msg", "两次输入密码不同");
request.getRequestDispatcher("/registe.jsp").forward(request, response);
return;
}
UserDao user = new UserDao();
user.addUser(username, password);
// request.setAttribute("msg", "恭喜" + username + "注册成功");
// request.getRequestDispatcher("/registe.jsp").forward(request, response);
HttpSession session = request.getSession();
session.setAttribute("loginName", username);
//System.out.println(session.getAttribute(username));
response.sendRedirect("IndexServlet");
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
毕设 天猫网,后台采用的是Java编写,以mysql作为数据库,前端使用html,css,js,jquery,ajax等
共76个文件
jpg:17个
js:10个
css:7个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 71 浏览量
2023-10-24
10:52:08
上传
评论
收藏 1.79MB ZIP 举报
温馨提示
matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行! matlab算法,毕设、课设程序,全部源码均已进行严格测试,可以直接运行!
资源推荐
资源详情
资源评论
收起资源包目录
毕设 这个项目主要模仿了天猫网,这个项目包括登录,注册,购物车模块,后台采用的是Java编写,以mysql作为数据库,前端使用html,css,js,jquery,ajax等.zip (76个子文件)
TianMao02-master
.classpath 825B
.settings
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.jdt.core.prefs 357B
.jsdtscope 555B
org.eclipse.wst.common.component 471B
org.eclipse.wst.common.project.facet.core.xml 335B
org.eclipse.wst.jsdt.ui.superType.container 49B
src
tianmao
dao
UserDao.java 2KB
entity
User.java 372B
tiaomao
servlet
RegisteServlet.java 2KB
IndexServlet.java 2KB
LoginServlet.java 2KB
ss.md 37B
build
classes
tianmao
dao
UserDao.class 2KB
entity
User.class 1006B
tiaomao
servlet
RegisteServlet.class 2KB
IndexServlet.class 2KB
LoginServlet.class 2KB
WebContent
WEB-INF
lib
mysql-connector-java-5.1.26-bin.jar 836KB
web.xml 950B
tianmao
js
jquerySession.js 4KB
jQuery.js 262KB
tianmao
js
server.js 2KB
cart.js 5KB
util.js 1002B
productMenu.js 13KB
index.js 6KB
img
catEar.png 585B
footer03_1.jpg 1KB
logo.gif 77KB
shafa04.jpg 10KB
tv03.jpg 7KB
tv04.jpg 13KB
shafa02.jpg 9KB
matong02.jpg 8KB
matong04.jpg 5KB
footer03_2.jpg 1KB
lunbo01.jpg 132KB
天猫超市.png 6KB
matong03.jpg 2KB
matong01.jpg 6KB
tv02.jpg 7KB
天猫.png 3KB
footer01.png 50KB
tv01.jpg 12KB
shafa03.jpg 10KB
天猫国际.png 6KB
手机天猫.png 845B
lunbo03.jpg 70KB
shafa01.jpg 12KB
lunbo02.jpg 140KB
css
cart.css 846B
index.css 5KB
dist
js
bootstrap.js 68KB
npm.js 484B
bootstrap.min.js 36KB
css
bootstrap-theme.min.css.map 25KB
bootstrap.min.css 118KB
bootstrap-theme.css.map 47KB
bootstrap-theme.css 26KB
bootstrap.css.map 380KB
bootstrap.css 143KB
bootstrap-theme.min.css 23KB
bootstrap.min.css.map 529KB
fonts
glyphicons-halflings-regular.svg 106KB
glyphicons-halflings-regular.ttf 44KB
glyphicons-halflings-regular.woff 23KB
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.woff2 18KB
css
base.css 60B
registe.jsp 742B
index.html 16KB
cart.html 1KB
META-INF
MANIFEST.MF 36B
login.jsp 724B
.project 1006B
共 76 条
- 1
资源评论
天天501
- 粉丝: 595
- 资源: 4666
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ItemApplicationTest.java
- 个人发卡源码,发卡系统,二次元发卡系统,二次元发卡源码,发卡程序,动漫发卡,PHP发卡源码,异次元发卡
- 基于matlab 决策树分类器的应用研究-乳腺癌诊断源代码+详细教程
- 2008全国电子设计竞赛优秀作品报告doc文档.zip
- 课程智能组卷系统 JAVA+Spring+SpringMVC+MyBatis
- 基于matlab LVQ神经网络的预测-人脸朝向识别源代码+详细教程
- Controlnet敏神大佬IC-Light的AI智能打光 AI这次真的大地震了
- 医院电子病历管理系统 JAVA+Spring+SpringMVC+MyBatis
- 基于matlab LVQ神经网络的分类-乳腺肿瘤诊断源代码+详细教程
- 【C#/.NET/.NET Core学习、工作、面试指南】记录、收集和总结
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功