Java 實(shí)戰(zhàn)項(xiàng)目錘煉之在線蛋糕商城系統(tǒng)的實(shí)現(xiàn)
一、項(xiàng)目簡(jiǎn)述
功能: 主頁顯示熱銷商品;所有蛋糕商品展示,可進(jìn)行商品搜 索;點(diǎn)擊商品進(jìn)入商品詳情頁,具有立即購買和加入購物 車功能,可增減購買商品數(shù)量亦可手動(dòng)輸入(同時(shí)驗(yàn)證庫 存),熱銷商品展示。立即購買進(jìn)入確認(rèn)訂單頁面,可選擇 已經(jīng)添加的地址,亦可新增地址。(同時(shí)驗(yàn)證庫存),可選 擇購買哪些商品,可刪除不需要的商品。點(diǎn)擊結(jié)算進(jìn)入確 認(rèn)訂單頁面,確認(rèn)后提交訂單。后臺(tái)管理:(修改密碼 等),商品管理(商品批量添加、上下架等),訂單管理。
二、項(xiàng)目運(yùn)行
環(huán)境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe ( IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
項(xiàng)目技術(shù): JSP + C3P0+ Servlert + html+ css + JavaScript + JQuery + Ajax + Fileupload





用戶登錄模塊代碼:
用戶登錄模塊:
@WebServlet(name = "user_login",urlPatterns = "/user_login")
public class UserLoginServlet extends HttpServlet {
private UserService uService = new UserService();
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String ue = request.getParameter("ue");
String password = request.getParameter("password");
User user = uService.login(ue, password);
if(user==null) {
request.setAttribute("failMsg", "用戶名、郵箱或者密碼錯(cuò)誤,請(qǐng)重新登錄!");
request.getRequestDispatcher("/user_login.jsp").forward(request, response);
}else {
request.getSession().setAttribute("user", user);
request.getRequestDispatcher("/user_center.jsp").forward(request, response);
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
管理員添加用戶代碼:
管理員添加用戶:
@WebServlet(name = "admin_user_add",urlPatterns = "/admin/user_add")
public class AdminUserAddServlet extends HttpServlet {
private UserService uService = new UserService();
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
User user = new User();
try {
BeanUtils.copyProperties(user, request.getParameterMap());
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(uService.register(user)) {
request.setAttribute("msg", "客戶添加成功!");
request.getRequestDispatcher("/admin/user_list").forward(request, response);
}else {
request.setAttribute("failMsg", "用戶名或郵箱重復(fù),請(qǐng)重新填寫!");
request.setAttribute("u",user);
request.getRequestDispatcher("/admin/user_add.jsp").forward(request, response);
}
}
}
到此這篇關(guān)于Java 實(shí)戰(zhàn)項(xiàng)目錘煉之在線蛋糕商城系統(tǒng)的實(shí)現(xiàn) 的文章就介紹到這了,更多相關(guān)Java 蛋糕商城系統(tǒng)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- Java畢業(yè)設(shè)計(jì)實(shí)戰(zhàn)之線上水果超市商城的實(shí)現(xiàn)
- Java畢業(yè)設(shè)計(jì)實(shí)戰(zhàn)項(xiàng)目之寵物商城系統(tǒng)的實(shí)現(xiàn)流程
- Java畢業(yè)設(shè)計(jì)實(shí)戰(zhàn)項(xiàng)目之在線服裝銷售商城系統(tǒng)的實(shí)現(xiàn)流程
- Java實(shí)戰(zhàn)花店商城系統(tǒng)的實(shí)現(xiàn)流程
- Java實(shí)戰(zhàn)玩具商城的前臺(tái)與后臺(tái)實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目錘煉之在線購書商城系統(tǒng)的實(shí)現(xiàn)流程
- Java 實(shí)戰(zhàn)項(xiàng)目錘煉之網(wǎng)上商城系統(tǒng)的實(shí)現(xiàn)流程
- Java畢業(yè)設(shè)計(jì)實(shí)戰(zhàn)之在線蛋糕銷售商城的實(shí)現(xiàn)
相關(guān)文章
Java的關(guān)鍵字與標(biāo)識(shí)符小結(jié)
這篇文章主要介紹了Java的關(guān)鍵字與標(biāo)識(shí)符,總結(jié)整理了Java各種常見的關(guān)鍵字與標(biāo)識(shí)符功能、用法及操作注意事項(xiàng),需要的朋友可以參考下2020-04-04
Mybatis 動(dòng)態(tài)SQL的幾種實(shí)現(xiàn)方法
這篇文章主要介紹了Mybatis 動(dòng)態(tài)SQL的幾種實(shí)現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-11-11
提示:Decompiled.class file,bytecode version如何解決
在處理Decompiled.classfile和bytecodeversion問題時(shí),通過修改Maven配置文件,添加阿里云鏡像并去掉默認(rèn)鏡像,解決了下載源的問題,同時(shí),檢查并修改了依賴版本,確保了問題的解決2024-12-12

