通过实现 ModelDriven 接口来接收请求参数,这种方法用的比较少,一般还是用前两种. 请求: <a href="user/user!add?name=xiaoer&age=33">添加用户</a> User类: package com.bjsxt.struts2.user.model; public class User { private String name; private int age; public String getName()…
用域模型接收参数 User类 package com.bjsxt.struts2.user.model; public class User { private String name; private int age; public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public…