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" %> + +
+