• 大小: 87.36MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-06-21
  • 语言: 其他
  • 标签: Spring  Struts2  Hibernate  

资源简介

基于Spring+Struts2+Hibernate模拟开发的电子商城,主要完成用户注册、商品显示、用户购买、结算,后台管理商品一级、二级目录等工作,是一个学习ssh框架很好的学习项目

资源截图

代码片段和文件信息

package stu.l.shop.admin.action;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import stu.l.shop.admin.entity.AdminUser;
import stu.l.shop.admin.service.AdminUserService;

/**
 * 后台用户登录action
 * Created by LXH on 2018/4/15.
 */
@Component
@Scope(“prototype“)
public class AdminUserAction extends ActionSupport implements ModelDriven {
    private AdminUser adminUser;

    @Autowired
    private AdminUserService adminUserService;

    public AdminUserAction() {
        adminUser = new AdminUser();
    }

    public String login() {
        // 调用service完成登录
        AdminUser existAdminUser = adminUserService.login(adminUser);
        if(existAdminUser == null) {
            // 登录失败
            this.addActionerror(“亲,用户名或密码错误“);
            return “loginFail“;
        } else {
            ServletActionContext.getRequest().getSession().setAttribute(“existAdminUser“ existAdminUser);
            return “loginSuccess“;
        }
    }

    @Override
    public AdminUser getModel() {
        return adminUser;
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-03-26 15:32  Shop\
     目录           0  2018-05-21 20:17  Shop\.idea\
     目录           0  2018-03-26 15:32  Shop\.idea\artifacts\
     文件        1431  2018-03-26 15:32  Shop\.idea\artifacts\Shop_war_exploded.xml
     目录           0  2018-04-03 12:10  Shop\.idea\inspectionProfiles\
     文件         525  2018-04-03 12:10  Shop\.idea\inspectionProfiles\Project_Default.xml
     目录           0  2018-03-26 15:32  Shop\.idea\libraries\
     文件         275  2018-03-22 23:14  Shop\.idea\libraries\activation.xml
     文件         220  2018-03-17 00:30  Shop\.idea\libraries\antlr_2_7_7.xml
     文件        1211  2018-03-16 00:08  Shop\.idea\libraries\asm_5_2.xml
     文件         222  2018-03-16 00:12  Shop\.idea\libraries\c3p0_0_9_5_2.xml
     文件         220  2018-03-16 00:20  Shop\.idea\libraries\dom4j_1_6_1.xml
     文件         280  2018-03-16 00:24  Shop\.idea\libraries\hibernate_commons_annotations_5_0_1_Final.xml
     文件         252  2018-03-26 15:32  Shop\.idea\libraries\hibernate_core_5_2_12_Final.xml
     文件         264  2018-03-16 00:18  Shop\.idea\libraries\hibernate_jpa_2_1_api_1_0_0_Final.xml
     文件         336  2018-03-16 00:15  Shop\.idea\libraries\mchange_commons_java_0_2_11.xml
     文件         220  2018-03-16 23:33  Shop\.idea\libraries\servlet_api.xml
     文件        1118  2018-03-16 00:10  Shop\.idea\libraries\spring_orm_4_3_14_RELEASE.xml
     文件         273  2018-03-15 13:40  Shop\.idea\misc.xml
     文件         248  2018-03-15 13:40  Shop\.idea\modules.xml
     文件        8792  2018-03-26 15:05  Shop\.idea\uiDesigner.xml
     文件       62775  2018-05-21 20:17  Shop\.idea\workspace.xml
     文件        2471  2018-03-26 15:32  Shop\Shop.iml
     目录           0  2018-03-26 15:31  Shop\lib\
     文件       56290  2007-10-18 02:05  Shop\lib\activation.jar
     文件      445288  2017-04-04 11:43  Shop\lib\antlr-2.7.7.jar
     文件       53259  2017-10-18 16:13  Shop\lib\asm-5.2.jar
     文件       47197  2017-10-18 16:13  Shop\lib\asm-commons-5.2.jar
     文件       29582  2017-10-18 16:13  Shop\lib\asm-tree-5.2.jar
     文件      497865  2017-04-04 11:48  Shop\lib\c3p0-0.9.5.2.jar
     文件       70604  2017-10-18 19:39  Shop\lib\commons-fileupload-1.3.3.jar
............此处省略973个文件信息

评论

共有 条评论