今天开发中碰到一个问题,struts的html标签对应actionform,其中标签属性和actionformjavabean属性要保持一致,而且要不全小写,要不全大写,比如:
password | true |
PASSWORD | true |
Password | false |
pASSWORD | false |
如果是大小混写的,则:打开jsp页面的时候(actionservlet会根据actionmapping马上组装相应的actionform)就会500错误
HTTP Status 500 -type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: No getter method for property PASs of bean org.apache.struts.taglib.html.BEAN org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781) org.apache.jsp.form.case_jsp._jspService(org.apache.jsp.form.case_jsp:91) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
root cause javax.servlet.jsp.JspException: No getter method for property PASs of bean org.apache.struts.taglib.html.BEAN org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968) org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176) org.apache.jsp.form.case_jsp._jspx_meth_html_text_0(org.apache.jsp.form.case_jsp:144) org.apache.jsp.form.case_jsp._jspx_meth_html_form_0(org.apache.jsp.form.case_jsp:112) org.apache.jsp.form.case_jsp._jspService(org.apache.jsp.form.case_jsp:81) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs. Apache Tomcat/5.5 |
原来还有这个限制
同时发现通过hibernate tools插件自动按照数据表生成javabean也很方便,而且没有像hibernate synchernize一定要生成basejavabean,生成的javabean的属性也都是小写的,不错。