diff --git a/src/com/ssm/controller/CarouselController.java b/src/com/ssm/controller/CarouselController.java new file mode 100644 index 0000000..2fbdb94 --- /dev/null +++ b/src/com/ssm/controller/CarouselController.java @@ -0,0 +1,20 @@ +package com.ssm.controller; + +import com.ssm.entity.Carousel; +import com.ssm.entity.Messagemodule; +import com.ssm.entity.User; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; +@Controller +@RequestMapping("hh") +public class CarouselController { + @RequestMapping("Carousel") + public ModelAndView test(Carousel carousel){ + carousel.printInfo(); + System.out.println("轮播信息:"+carousel.toString()); + ModelAndView cl = new ModelAndView("showCarousel"); + cl.addObject("printInfo", carousel); + return cl; + } +} diff --git a/src/com/ssm/entity/Carousel.java b/src/com/ssm/entity/Carousel.java new file mode 100644 index 0000000..6c4ac53 --- /dev/null +++ b/src/com/ssm/entity/Carousel.java @@ -0,0 +1,43 @@ +package com.ssm.entity; +public class Carousel { + private String clid;//轮播id + private String clpicture;//轮图片 + private String cldate;//轮播日期 + private String clcontent;//轮播内容 + + public String getClid() { + return clid; + } + + public void setClid(String clid) { + this.clid = clid; + } + + public String getClpicture() { + return clpicture; + } + + public void setClpicture(String clpicture) { + this.clpicture = clpicture; + } + + public String getCldate() { + return cldate; + } + + public void setCldate(String cldate) { + this.cldate = cldate; + } + + public String getClcontent() { + return clcontent; + } + + public void setClcontent(String clcontent) { + this.clcontent = clcontent; + } + public void printInfo(){ + System.out.println("轮播id="+clid +"\n轮播图片="+clpicture+"\n轮播日期="+cldate+"\n轮播内容="+clcontent); + } + +} \ No newline at end of file diff --git a/web/WEB-INF/view/showCarousel.jsp b/web/WEB-INF/view/showCarousel.jsp new file mode 100644 index 0000000..b49cdb8 --- /dev/null +++ b/web/WEB-INF/view/showCarousel.jsp @@ -0,0 +1,28 @@ +<%-- + Created by IntelliJ IDEA. + User: lenovo + Date: 2025/4/2 + Time: 17:22 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + CarouselController + + +Success! +
+轮播id:${printInfo.clid} +
+
+:轮播图片${printInfo.clpicture} +
+
+轮播日期:${printInfo.cldate} +
+
+轮播内容:${printInfo.clcontent} +
+ + diff --git a/web/addCarousel.jsp b/web/addCarousel.jsp new file mode 100644 index 0000000..6e9c968 --- /dev/null +++ b/web/addCarousel.jsp @@ -0,0 +1,44 @@ +<%-- + Created by IntelliJ IDEA. + User: lenovo + Date: 2025/4/2 + Time: 17:27 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 添加轮播图片 + + +
+ + 轮播id + + + + + 轮播图片 + + + + + 轮播日期 + + + + + 轮播内容 + + + + + + + + + + +
+ +