From 3c87a567699a5f3e641f4e1d5e5988167748dca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BD=B3=E8=BE=89?= <3327510663@qq.com> Date: Mon, 7 Apr 2025 13:21:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E6=B7=BBpublicManagement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 宋佳辉 <3327510663@qq.com> --- .../ssm/controller/CategoryController.java | 19 ++++++++ src/com/ssm/entity/Category.java | 44 ++++++++++++++++++ web/WEB-INF/view/showCategory.jsp | 29 ++++++++++++ .../view/showPublicManagement.jsp} | 20 +++++++-- web/addCategory.jsp | 45 +++++++++++++++++++ web/addpublicManagement.jsp | 45 +++++++++++++++++++ 6 files changed, 198 insertions(+), 4 deletions(-) create mode 100644 src/com/ssm/controller/CategoryController.java create mode 100644 src/com/ssm/entity/Category.java create mode 100644 web/WEB-INF/view/showCategory.jsp rename web/{publicManagement.jsp => WEB-INF/view/showPublicManagement.jsp} (50%) create mode 100644 web/addCategory.jsp create mode 100644 web/addpublicManagement.jsp diff --git a/src/com/ssm/controller/CategoryController.java b/src/com/ssm/controller/CategoryController.java new file mode 100644 index 0000000..cc9e1ae --- /dev/null +++ b/src/com/ssm/controller/CategoryController.java @@ -0,0 +1,19 @@ +package com.ssm.controller; + +import com.ssm.entity.Category; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + @Controller + @RequestMapping("sjh") + public class CategoryController { + @RequestMapping("Category") + public ModelAndView test(Category category) { + category.printInfo(); + System.out.println("类目信息:" + category.toString()); + ModelAndView cc = new ModelAndView("showCategory"); + cc.addObject("printInfo", category); + return cc; + } + } + diff --git a/src/com/ssm/entity/Category.java b/src/com/ssm/entity/Category.java new file mode 100644 index 0000000..062896a --- /dev/null +++ b/src/com/ssm/entity/Category.java @@ -0,0 +1,44 @@ +package com.ssm.entity; + +public class Category { + private String ccgoods;//商品属性 + private String ccinventory;//库存管理属性 + private String ccsale;//销售属性 + private String cclogistics;//物流属性 + + public String getCcgoods() { + return ccgoods; + } + + public void setCcgoods(String ccgoods) { + this.ccgoods = ccgoods; + } + + public String getCcinventory() { + return ccinventory; + } + + public void setCcinventory(String ccinventory) { + this.ccinventory = ccinventory; + } + + public String getCcsale() { + return ccsale; + } + + public void setCcsale(String ccsale) { + this.ccsale = ccsale; + } + + public String getCclogistics() { + return cclogistics; + } + + public void setCclogistics(String cclogistics) { + this.cclogistics = cclogistics; + } + public void printInfo(){ + System.out.println("商品属性="+ccgoods +"\n库存管理属性="+ccinventory+"\n销售属性="+ccsale+"\n物流属性="+cclogistics); + } +} + diff --git a/web/WEB-INF/view/showCategory.jsp b/web/WEB-INF/view/showCategory.jsp new file mode 100644 index 0000000..8bd703d --- /dev/null +++ b/web/WEB-INF/view/showCategory.jsp @@ -0,0 +1,29 @@ +<%-- + Created by IntelliJ IDEA. + User: 33275 + Date: 2025/4/7 + Time: 20:16 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + +
+