- @Controller
- @RequestMapping("/test")
- public class TestController {
- @Autowired
- private TestService testService;
- //重点
- @InitBinder("javaBeanA")
- public void initBinderFormBean1(WebDataBinder binder) {
- binder.setFieldDefaultPrefix("javaBean1.");
- }
- @InitBinder("javaBeanB")
- public void initBinderFormBean2(WebDataBinder binder) {
- binder.setFieldDefaultPrefix("javaBean2.");
- }
- @RequestMapping("/create")
- @ResponseBody
- public String create(JavaBeanA javaBeanA, JavaBeanb javaBeanB){
- testService.save(javaBeanA, javaBeanB);
- return SUCCESS
- }
- }
springmvc 传多个DOMAIN对像
最新推荐文章于 2023-12-29 16:50:20 发布