赞
踩
蛋糕商城项目完整源码,包括css、js和本系统数据库表设计语句。可供Javaweb大作业参考,毕业设计参考、兴趣学习等。
项目代码
注册jsp代码
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-
-
- <!DOCTYPE html>
- <html>
- <head>
- <title>用户注册</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <link type="text/css" rel="stylesheet" href="css/bootstrap.css">
- <link type="text/css" rel="stylesheet" href="css/style.css">
- <script type="text/javascript" src="js/jquery.min.js"></script>
- <script type="text/javascript" src="js/bootstrap.min.js"></script>
- <script type="text/javascript" src="js/simpleCart.min.js"></script>
- </head>
- <body>
-
- <!--header-->
- <jsp:include page="/header.jsp">
- <jsp:param name="flag" value="10"></jsp:param>
- </jsp:include>
- <!--//header-->
-
-
- <!--account-->
- <div class="account">
- <div class="container">
- <div class="register">
- <c:if test="${!empty msg }">
- <div class="alert alert-danger">${msg }</div>
- </c:if>
- <form action="/user_rigister" method="post">
- <div class="register-top-grid">
- <h3>注册新用户</h3>
- <div class="input">
- <span>用户名 <label style="color:red;">*</label></span>
- <input type="text" name="username" placeholder="请输入用户名" required="required">
- </div>
- <div class="input">
- <span>邮箱 <label style="color:red;">*</label></span>
- <input type="text" name="email" placeholder="请输入邮箱" required="required">
- </div>
- <div class="input">
- <span>密码 <label style="color:red;">*</label></span>
- <input type="password" name="password" placeholder="请输入密码" required="required">
- </div>
- <div class="input">
- <span>收货人<label></label></span>
- <input type="text" name="name" placeholder="请输入收货">
- </div>
- <div class="input">
- <span>收货电话<label></label></span>
- <input type="text" name="phone" placeholder="请输入收货电话">
- </div>
- <div class="input">
- <span>收货地址<label></label></span>
- <input type="text" name="address" placeholder="请输入收货地址">
- </div>
- <div class="clearfix"> </div>
- </div>
- <div class="register-but text-center">
- <input type="submit" value="提交">
- <div class="clearfix"> </div>
- </div>
- </form>
- <div class="clearfix"> </div>
- </div>
- </div>
- </div>
- <!--//account-->
-
-
-
-
-
-
- <!--footer-->
- <jsp:include page="/footer.jsp"></jsp:include>
- <!--//footer-->
-
-
- </body>
- </html>
注册servlet代码
- package servlet;
-
- import java.io.IOException;
- import java.lang.reflect.InvocationTargetException;
- 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 model.User;
- import org.apache.commons.beanutils.BeanUtils;
- import service.UserService;
-
- @WebServlet(
- name = "user_register",
- urlPatterns = {"/user_rigister"}
- )
- public class UserRegisterServlet extends HttpServlet {
- private UserService uService = new UserService();
-
- public UserRegisterServlet() {
- }
-
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- User user = new User();
-
- try {
- BeanUtils.copyProperties(user, request.getParameterMap());
- } catch (IllegalAccessException var5) {
- var5.printStackTrace();
- } catch (InvocationTargetException var6) {
- var6.printStackTrace();
- }
-
- if (this.uService.register(user)) {
- request.setAttribute("msg", "注册成功,请登录!");
- request.getRequestDispatcher("user_login.jsp").forward(request, response);
- } else {
- request.setAttribute("msg", "用户名或邮箱重复,请重新填写!");
- request.getRequestDispatcher("user_register.jsp").forward(request, response);
- }
-
- }
-
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- }
- }
注册界面
登录界面
商城首页界面
商品分类界面
商品管理界面
购物车界面
订单界面
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。