Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-1050

NullPointerException in <s:ifMessage/>

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.6
    • 1.1.7
    • Message(s)
    • None

    Description

      Omitting the 'for' attribute using <s:ifMessage/> causes a NullPointerException
      although the attribute is declared as 'not required' in the TLD:

      Caused by: java.lang.NullPointerException
      at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
      at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
      at org.apache.myfaces.custom.ifmessage.IfMessage.encodeChildren(IfMessage.java:75)
      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:414)
      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:400)
      at org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:78)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
      at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:498)
      at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:366)
      at org.apache.myfaces.shared_impl.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:57)
      at org.apache.jsp.test_jsp._jspx_meth_h_panelGroup_0(org.apache.jsp.test_jsp:230)
      at org.apache.jsp.test_jsp._jspx_meth_h_form_0(org.apache.jsp.test_jsp:157)
      at org.apache.jsp.test_jsp._jspx_meth_f_view_0(org.apache.jsp.test_jsp:125)
      at org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:89)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:80)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
      ... 33 more

      The attached patch solves this problem. The component now considers
      messages for all components if the "for" attribute is not used.

      Attachments

        1. ifmessage-nullpointer.patch
          1.0 kB
          Christian Kaltepoth

        Activity

          People

            grantsmith Grant Smith
            chkal Christian Kaltepoth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: