基于web的订餐系统


基于web的订餐系统,有用户登录注册功能、菜单浏览功能、购物车、菜单管理、评论以及评论管理等等功能,有前端后台,用jsp编写,编写工具为eclipse,用到hibermate等框架。
资源截图
代码片段和文件信息
package com.action;

import java.util.HashMap;
import java.util.Map;
import org.apache.struts2.interceptor.SessionAware;

import com.biz.MealBiz;
import com.biz.MealSeriesBiz;
import com.entity.CartItemBean;
import com.entity.Meal;
import com.opensymphony.xwork2.ActionSupport;

public class CartAction extends ActionSupport implements SessionAware {
private Integer mealId;
public void setMealId(Integer mealId) {
this.mealId = mealId;
}
public Integer getMealId() {
return mealId;
}
int quantity;
public int getQuantity() {
return quantity;
}
public void setQuantity(int quantity) {
this.quantity = quantity;
}
MealBiz mealBiz;
public void setMealBiz(MealBiz mealBiz) {
this.mealBiz = mealBiz;
}
MealSeriesBiz mealSeriesBiz;
public void setMealSeriesBiz(MealSeriesBiz mealSeriesBiz) {
this.mealSeriesBiz = mealSeriesBiz;
}
Mapject> session;
@Override
public void setSession(Mapject> session) {
this.session=session;
}
//将餐品添加到购物车
public String addtoshopcart() throws Exception {
//从session中取出购物车,放入Map对象cart中
Map cart=(Map)session.get(“cart“);
Meal meal=mealBiz.getMealByMealId(mealId);
if(cart==null){
cart=new HashMap();
session.put(“cart“ cart);
}
CartItemBean cartItem=(CartItemBean)cart.get(meal.getMealId());
if(cartItem!=null){
    //如果餐品在购物车中,更新其数量
cartItem.setQuantity(cartItem.getQuantity()+1);
}else{
//否则,创建一个条目到Map中
cart.put(meal.getMealId()new CartItemBean(meal1));
}
return “shopCart“;
}

//更改数量
public String updateSelectedQuantity() throws Exception {
//从session中取出购物车,放入Map对象cart中
    Map cart=(Map)session.get(“cart“);
    CartItemBean cartItem=(CartItemBean)cart.get(mealId);
    cartItem.setQuantity(quantity);
    return “shopCart“;
}

//从购物车中移除指定编号订单
public String deleteSelectedOrders() throws Exception {
//从session中取出购物车,放入Map对象cart中
    Map cart=(Map)session.get(“cart“);
    cart.remove(mealId);
    return “shopCart“;
}

//清空购物车
public String clearCart() throws Exception {
//从session中取出购物车,放入Map对象cart中
        try {
    Map cart=(Map)session.get(“cart“);
    cart.clear();
    return “shopCart“;
} catch (Exception e) {
  return “shopCart“;
}
}


}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-06-11 12:48  基于web的订餐系统
     文件     2195309  2018-06-11 12:48  基于web的订餐系统报告.doc
     目录           0  2017-06-21 05:12  基于web的订餐系统代码
     目录           0  2017-06-21 05:07  基于web的订餐系统代码DingCan
     文件         842  2016-10-09 19:03  基于web的订餐系统代码DingCan.classpath
     文件         907  2016-11-28 10:53  基于web的订餐系统代码DingCan.project
     目录           0  2017-06-21 05:07  基于web的订餐系统代码DingCan.settings
     文件         567  2016-10-09 19:03  基于web的订餐系统代码DingCan.settings.jsdtscope
     文件         670  2016-12-05 09:25  基于web的订餐系统代码DingCan.settingsorg.eclipse.jdt.core.prefs
     文件        2746  2016-12-05 09:25  基于web的订餐系统代码DingCan.settingsorg.eclipse.jdt.ui.prefs
     文件         473  2016-11-28 10:53  基于web的订餐系统代码DingCan.settingsorg.eclipse.wst.common.component
     文件         345  2016-10-09 19:03  基于web的订餐系统代码DingCan.settingsorg.eclipse.wst.common.project.facet.core.xml
     文件          49  2016-10-09 19:03  基于web的订餐系统代码DingCan.settingsorg.eclipse.wst.jsdt.ui.superType.container
     文件           6  2016-10-09 19:03  基于web的订餐系统代码DingCan.settingsorg.eclipse.wst.jsdt.ui.superType.name
     文件          95  2016-11-28 10:53  基于web的订餐系统代码DingCan.settingsorg.jboss.ide.eclipse.as.core.prefs
     目录           0  2017-06-21 05:07  基于web的订餐系统代码DingCanWebContent
     目录           0  2017-06-21 05:07  基于web的订餐系统代码DingCanWebContentmeta-INF
     文件          39  2016-10-09 19:03  基于web的订餐系统代码DingCanWebContentmeta-INFMANIFEST.MF
     文件         706  2016-12-19 06:15  基于web的订餐系统代码DingCanWebContentUpdate_success.jsp
     目录           0  2017-06-21 05:07  基于web的订餐系统代码DingCanWebContentWEB-INF
     目录           0  2017-06-21 05:07  基于web的订餐系统代码DingCanWebContentWEB-INFlib
     文件      358273  2017-06-20 20:09  基于web的订餐系统代码DingCanWebContentWEB-INFlibantlr-2.7.2.jar
     文件      445288  2017-06-20 20:09  基于web的订餐系统代码DingCanWebContentWEB-INFlibantlr-2.7.7.jar
     文件        4467  2017-06-20 20:09  基于web的订餐系统代码DingCanWebContentWEB-INFlibaopalliance-1.0.jar
     文件       53468  2017-06-20 20:33  基于web的订餐系统代码DingCanWebContentWEB-INFlibasm-5.1.jar
     文件       47195  2017-06-20 20:33  基于web的订餐系统代码DingCanWebContentWEB-INFlibasm-commons-5.1.jar
     文件       29130  2017-06-20 20:15  基于web的订餐系统代码DingCanWebContentWEB-INFlibasm-tree-5.1.jar
     文件     1663623  2017-06-20 20:09  基于web的订餐系统代码DingCanWebContentWEB-INFlibaspectjweaver-1.6.9.jar
     文件      610790  2017-06-20 20:09  基于web的订餐系统代码DingCanWebContentWEB-INFlibc3p0-0.9.1.2.jar
     文件      608376  2017-06-20 20:09  基于web的订餐系统代码DingCanWebContentWEB-INFlibc3p0-0.9.1.jar
     文件      322362  2017-06-20 20:09  基于web的订餐系统代码DingCanWebContentWEB-INFlibcglib-nodep-2.2.jar
............此处省略316个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)