在服务器中,我有一个像这样的bean:
@Data
public class TechInfo {
private int shopID;
private String name;
private int experience;
TechnicianTitleInfo technicianTitleInfo;
private String skill;
}
如何获取Struts2中的请求参数?
我在我的操作中声明了一个 TechInfo,但在 Struts2 解析它之后它的值为 null。
Action 是这样的:
public class AjaxAction{
@Getter @Setter private TechInfo techInfo;
protected void jsonExecute() throws Exception {
//need the techInfo
}
}
最佳答案
正确的参数格式是使用点表示法的格式:
techInfo.picID
techInfo.name
techInfo.technicianTitleInfo.titleId
等等。
关于java - 如何在Struts 2中获取内容类型为x-www-form-urlencoded的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41389854/