SpingMVC ModelAttribute的用法

SpingMVC ModelAttribute的用法
@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");
    }
}
SpingMVC ModelAttribute的用法


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

SpingMVC ModelAttribute的用法,布布扣,bubuko.com

SpingMVC ModelAttribute的用法

上一篇:HTML文本载入HTMLDocument2进行解析


下一篇:如何高质量优化自己网站提高排名?