SpingMVC ModelAttribute的用法

2020-12-13 06:04

阅读:454

标签:style   blog   class   c   code   java   

soscw.com,搜素材
@Controller
@RequestMapping(value = "/test")
public class TestController {
    @RequestMapping("/addUser")
    public void addUser(@ModelAttribute(value = "adminUser") AdminUser adminUser, Writer writer) throws IOException {
        System.out.println("adminUser = " + adminUser);
        writer.write("successfully");
    }

    @RequestMapping("/addUser2")
    public void addUser2(AdminUser adminUser2, Writer writer) throws IOException {
        System.out.println("adminUser2 = " + adminUser2);
        writer.write("successfully2");
    }
}
soscw.com,搜素材


两种写法都能达到一样的效果。

SpingMVC ModelAttribute的用法,搜素材,soscw.com

SpingMVC ModelAttribute的用法

标签:style   blog   class   c   code   java   

原文地址:http://www.cnblogs.com/wuyou/p/3739547.html


评论


亲,登录后才可以留言!