打赏

SSM与jsp传递实体类

jsp传controller

Controller:

@RequestMapping({"/user"})
public void registerUser(User uu)
throws Exception
{
System.out.println(uu.getPhone());
}

jsp:

<form>

<input id="reg_username" name="phone" type="text" class="form-control" placeholder="手机号" datatype="m" errormsg="请输入手机号"/>

</form>

实体类:

public class User {
private String phone;//

public String getPhone() {
return phone;
}

public void setPhone(String phone) {
this.phone = phone;
}

}

 

controller传jsp

controller传对像,jsp页面用对象.属性接收

posted @ 2017-12-28 18:24  每天都要学一点  阅读(2001)  评论(0编辑  收藏  举报