diff --git a/src/com/ssm/controller/FirstController.java b/src/com/ssm/controller/FirstController.java index 1618ff1..5abfb9b 100644 --- a/src/com/ssm/controller/FirstController.java +++ b/src/com/ssm/controller/FirstController.java @@ -5,14 +5,9 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller -@RequestMapping("testFC") public class FirstController { - @RequestMapping("object") - public String hello(Cate cate) { - System.out.println("cateid:"+cate.getCateid()); - System.out.println("catename:"+cate.getCatename()); - System.out.println("addtime:"+cate.getAddtime()); - System.out.println("memo:"+cate.getMemo()); + @RequestMapping("hello") + public String hello() { return "showFirst"; } } diff --git a/src/com/ssm/controller/LabxController.java b/src/com/ssm/controller/LabxController.java index 63ff9a0..622ac66 100644 --- a/src/com/ssm/controller/LabxController.java +++ b/src/com/ssm/controller/LabxController.java @@ -11,12 +11,13 @@ public class LabxController { //对象方式接收数据,ModelAndView对象响应数据 @RequestMapping("add") - public ModelAndView test(Labx laboratory){ + public ModelAndView test(Labx laboratory) { //创建ModelAndView对象的同时设置了view的信息 ModelAndView mv=new ModelAndView("showLaboratory"); //将这个对象laboratory保存到ModelAndView对象中 mv.addObject("laboratoryInfo", laboratory); return mv; - } - } +} + + diff --git a/web/WEB-INF/view/showLaboratory.jsp b/web/WEB-INF/view/showLaboratory.jsp index 40ffdcd..bd5b740 100644 --- a/web/WEB-INF/view/showLaboratory.jsp +++ b/web/WEB-INF/view/showLaboratory.jsp @@ -8,7 +8,8 @@
Success! -