我之前使用过scriptlet,但现在我切换到了mvc.我无法在JSP页面上检索值并获得错误:
javax.el.PropertyNotFoundException: Property 'tname' not found on type java.lang.String
Run Code Online (Sandbox Code Playgroud)
豆的代码:
public class regForm extends org.apache.struts.validator.ValidatorForm implements Iprafunctions {
private String tname = null;
private String tfee = null;
public String getTfee() {
return tfee;
}
public void setTfee(String tfee) {
this.tfee = tfee;
}
public String getTname() {
return tname;
}
public void setTname(String tname) {
this.tname = tname;
}
public regForm() {
super();
}
}
Run Code Online (Sandbox Code Playgroud)
动作控制器:
public ActionForward mvc(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception { …Run Code Online (Sandbox Code Playgroud)