我用struts 2 的实体和页面
action :
private TGxGoout tGxGoout = new TGxGoout();
public TGxGoout gettGxGoout() {
return tGxGoout;
}
public void settGxGoout(TGxGoout tGxGoout) {
this.tGxGoout = tGxGoout;
}
页面:<input id="tGxGoout_beginTime" readonly name="tGxGoout.beginTime" type="text" style="width:80%;" class="searchtxt" value="${tGxGoout.beginTime}"/>
不管是我新增还是编辑都会报错:ognl.OgnlException: target is null for setProperty(null, "id", [Ljava.lang.String;@2d56d401)
如果我改了action的tGxGoout 变量名,然后程序就可以正常运行。
求大神指教这是什么情况啊?
可能是OGNL规范认为javabean的setter/getter方法的set/get后第一个字母要大写
命名规范什么事都没有
变量的命名问题,建议不要用tGxGoout这样的命名,命名时,第一个和第二个字母都要小写,然后用IDE自动生成get/set方法我想知道这到底是什么原因造成的??ONGL的规范吗?版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。