所有资源已加载,任务完成

main
30424 4 months ago
parent df031b2513
commit 695641bc39

@ -5,14 +5,9 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@Controller @Controller
@RequestMapping("testFC")
public class FirstController { public class FirstController {
@RequestMapping("object") @RequestMapping("hello")
public String hello(Cate cate) { public String hello() {
System.out.println("cateid:"+cate.getCateid());
System.out.println("catename:"+cate.getCatename());
System.out.println("addtime:"+cate.getAddtime());
System.out.println("memo:"+cate.getMemo());
return "showFirst"; return "showFirst";
} }
} }

@ -11,12 +11,13 @@ public class LabxController {
//对象方式接收数据ModelAndView对象响应数据 //对象方式接收数据ModelAndView对象响应数据
@RequestMapping("add") @RequestMapping("add")
public ModelAndView test(Labx laboratory){ public ModelAndView test(Labx laboratory) {
//创建ModelAndView对象的同时设置了view的信息 //创建ModelAndView对象的同时设置了view的信息
ModelAndView mv=new ModelAndView("showLaboratory"); ModelAndView mv=new ModelAndView("showLaboratory");
//将这个对象laboratory保存到ModelAndView对象中 //将这个对象laboratory保存到ModelAndView对象中
mv.addObject("laboratoryInfo", laboratory); mv.addObject("laboratoryInfo", laboratory);
return mv; return mv;
}
} }
}

@ -8,7 +8,8 @@
</head> </head>
<body> <body>
Success! Success!
<br>
<br>
实验室编号:${laboratoryInfo.labxid} 实验室编号:${laboratoryInfo.labxid}
<br> <br>
实验室名称:${laboratoryInfo.labxname} 实验室名称:${laboratoryInfo.labxname}

@ -7,19 +7,6 @@
<title>添加实验室信息</title> <title>添加实验室信息</title>
</head> </head>
<body> <body>
<form action="laboratory/add" method="post"> <a href="hello">Hello world!</a>
实验室编号:<input type="text" name="labxid">
<br>
实验室名称:<input type="text" name="labxname">
<br>
负责人:<input type="text" name="manager">
<br>
联系方式:<input type="text" name="contact">
<br>
地址:<input type="text" name="address">
<br>
<input type="submit" value="添加">
</form>
</body> </body>
</html> </html>

@ -7,12 +7,6 @@
<title>showFirst!</title> <title>showFirst!</title>
</head> </head>
<body> <body>
<form action="testFC/object" method="post"> <a href="hello">hello world</a>
设备类型:<input type="text" name="cateid"><br>
类型名称:<input type="text" name="catename"><br>
创建日期:<input type="text" name="addtime"><br>
备注:<input type="text" name="memo">
<input type="submit" value="提交">
</form>
</body> </body>
</html> </html>
Loading…
Cancel
Save