小编Man*_*der的帖子

javax.el.PropertyNotFoundException:在类型java.lang.String上找不到属性'tname'

我之前使用过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)

java jsp struts jstl el

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

el ×1

java ×1

jsp ×1

jstl ×1

struts ×1