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頁面用對象.屬性接收