Struts1.2中标签显示Long,Integer类型异常

例如:
   <bean:write name="xxForm" property="typeId"/> 如果 这个 typeId 为 Long,Integer,BigDecimal类型时.会抛出

javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE
        at org.apache.struts.taglib.TagUtils.retrieveMessageResources(TagUtils.java:1252)
        at org.apache.struts.taglib.TagUtils.message(TagUtils.java:1101)
        at org.apache.struts.taglib.TagUtils.message(TagUtils.java:1076)
        at org.apache.struts.taglib.bean.WriteTag.retrieveFormatString(WriteTag.java:254)
        at org.apache.struts.taglib.bean.WriteTag.formatValue(WriteTag.java:317)
        at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:232)
        at org.apache.jsp.client$jsp._jspService(client$jsp.java:379)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)

解决办法:
   为 <bean:write format="#"> 标签 加上 format属性.就能解决这个问题.同样在显示时间类型的时候,format 属性可以用来格式化 时间格式!
MARK!

你可能感兴趣的:(java,apache,bean,struts,servlet)