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

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;
@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";
}
}

@ -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;
}
}
}

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

@ -7,19 +7,6 @@
<title>添加实验室信息</title>
</head>
<body>
<form action="laboratory/add" method="post">
实验室编号:<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>
<a href="hello">Hello world!</a>
</body>
</html>

@ -7,12 +7,6 @@
<title>showFirst!</title>
</head>
<body>
<form action="testFC/object" method="post">
设备类型:<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>
<a href="hello">hello world</a>
</body>
</html>
Loading…
Cancel
Save