打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
spingmvc使用POJO作为参数
提交的表单
<form action="springmvc/testPojo" method="post">
username:<input type="text" name="username"><br>
password:<input type="password" name="password"><br>
email:<input type="text" name="email"><br> age:<input
type="text" name="age"><br> city:<input type="text"
name="address.city"><br> provice:<input type="text"
name="address.provice"> <input type="submit" value="submit">
</form>
POJO实现方法
         /*
* SpringMVC会按请求参数名和POJO属性名自动匹配
* 自动为该对象填充属性值,支持级联属性,如dept.deptId.dept.address.tel等
*/
@RequestMapping("/testPojo")
public String testPojo(User user){
System.out.println("testPojo"+user);
return SUCCESS;
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
关于form表单同时使用POST和GET传递参数说明
input属性 隐藏 只读 限制
JSP把表单数据保存到本地txt
JSP中 input type 用法
变着花样来接参,PHP中接收外部参数的方式
a标签实现表单提交按钮
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服