当前位置:   article > 正文

蛋糕商城项目完整源码_javaweb程序设计蛋糕商城注册页面源代码

javaweb程序设计蛋糕商城注册页面源代码

蛋糕商城项目完整源码,包括css、js和本系统数据库表设计语句。可供Javaweb大作业参考,毕业设计参考、兴趣学习等。

开发环境

  • 开发语言:Java
  • 技术:JavaWeb【Servlet】
  • 数据库:MySQL
  • 架构:B/S
  • 源码类型: Web
  • 编译工具:IDEA
  • 其他:jdk1.8、Tomcat8.5 、Navicat

 项目代码91f10677467545b9b422d0f41b9fd305.png

 注册jsp代码

  1. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>用户注册</title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  9. <link type="text/css" rel="stylesheet" href="css/bootstrap.css">
  10. <link type="text/css" rel="stylesheet" href="css/style.css">
  11. <script type="text/javascript" src="js/jquery.min.js"></script>
  12. <script type="text/javascript" src="js/bootstrap.min.js"></script>
  13. <script type="text/javascript" src="js/simpleCart.min.js"></script>
  14. </head>
  15. <body>
  16. <!--header-->
  17. <jsp:include page="/header.jsp">
  18. <jsp:param name="flag" value="10"></jsp:param>
  19. </jsp:include>
  20. <!--//header-->
  21. <!--account-->
  22. <div class="account">
  23. <div class="container">
  24. <div class="register">
  25. <c:if test="${!empty msg }">
  26. <div class="alert alert-danger">${msg }</div>
  27. </c:if>
  28. <form action="/user_rigister" method="post">
  29. <div class="register-top-grid">
  30. <h3>注册新用户</h3>
  31. <div class="input">
  32. <span>用户名 <label style="color:red;">*</label></span>
  33. <input type="text" name="username" placeholder="请输入用户名" required="required">
  34. </div>
  35. <div class="input">
  36. <span>邮箱 <label style="color:red;">*</label></span>
  37. <input type="text" name="email" placeholder="请输入邮箱" required="required">
  38. </div>
  39. <div class="input">
  40. <span>密码 <label style="color:red;">*</label></span>
  41. <input type="password" name="password" placeholder="请输入密码" required="required">
  42. </div>
  43. <div class="input">
  44. <span>收货人<label></label></span>
  45. <input type="text" name="name" placeholder="请输入收货">
  46. </div>
  47. <div class="input">
  48. <span>收货电话<label></label></span>
  49. <input type="text" name="phone" placeholder="请输入收货电话">
  50. </div>
  51. <div class="input">
  52. <span>收货地址<label></label></span>
  53. <input type="text" name="address" placeholder="请输入收货地址">
  54. </div>
  55. <div class="clearfix"> </div>
  56. </div>
  57. <div class="register-but text-center">
  58. <input type="submit" value="提交">
  59. <div class="clearfix"> </div>
  60. </div>
  61. </form>
  62. <div class="clearfix"> </div>
  63. </div>
  64. </div>
  65. </div>
  66. <!--//account-->
  67. <!--footer-->
  68. <jsp:include page="/footer.jsp"></jsp:include>
  69. <!--//footer-->
  70. </body>
  71. </html>

注册servlet代码 

  1. package servlet;
  2. import java.io.IOException;
  3. import java.lang.reflect.InvocationTargetException;
  4. import javax.servlet.ServletException;
  5. import javax.servlet.annotation.WebServlet;
  6. import javax.servlet.http.HttpServlet;
  7. import javax.servlet.http.HttpServletRequest;
  8. import javax.servlet.http.HttpServletResponse;
  9. import model.User;
  10. import org.apache.commons.beanutils.BeanUtils;
  11. import service.UserService;
  12. @WebServlet(
  13. name = "user_register",
  14. urlPatterns = {"/user_rigister"}
  15. )
  16. public class UserRegisterServlet extends HttpServlet {
  17. private UserService uService = new UserService();
  18. public UserRegisterServlet() {
  19. }
  20. protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  21. User user = new User();
  22. try {
  23. BeanUtils.copyProperties(user, request.getParameterMap());
  24. } catch (IllegalAccessException var5) {
  25. var5.printStackTrace();
  26. } catch (InvocationTargetException var6) {
  27. var6.printStackTrace();
  28. }
  29. if (this.uService.register(user)) {
  30. request.setAttribute("msg", "注册成功,请登录!");
  31. request.getRequestDispatcher("user_login.jsp").forward(request, response);
  32. } else {
  33. request.setAttribute("msg", "用户名或邮箱重复,请重新填写!");
  34. request.getRequestDispatcher("user_register.jsp").forward(request, response);
  35. }
  36. }
  37. protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  38. }
  39. }

注册界面 c753025dfbbf49bdb482c7468d22620d.png

 

登录界面 

 a854d9f94a06447e87a5b7df29c89e5c.png

 

商城首页界面

53672ff648b04376a682ec17c6e9a3be.jpeg

 

商品分类界面 

c1ead445c43a43a1a5394fbfc616be81.jpeg

 

商品管理界面  

4f5782af8e604424b772da94da37030e.jpeg

 

 购物车界面

de401de0befc491299bb06df1768e7fa.jpeg

订单界面 

02061071ea464ac2916c5e94e856c4db.jpeg

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/767026
推荐阅读
相关标签
  

闽ICP备14008679号