Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1592

cannot render selectBooleanCheckbox tag when a boolean value is supplied

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.0
    • 1.2.0
    • JSR-252
    • None

    Description

      The tag descriptor generated by the maven plugin for HtmlSelectBooleanCheckboxTag has the following attribute:
      <attribute>
      <description><![CDATA[The initial value of this component.]]></description>
      <name>value</name>
      <deferred-value></deferred-value>
      </attribute>

      So when a JSP contains a tag like this:
      <h:selectBooleanCheckbox id="foo1" value="true"/>

      The following unhandled exception is thrown:
      javax.servlet.ServletException: Expected submitted value of type Boolean for Component :

      {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /mytest.jsp][Class: javax.faces.component.html.HtmlForm,Id: form][Class: javax.faces.component.html.HtmlSelectBooleanCheckbox,Id: foo1]}

      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
      at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:333)
      at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:543)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
      at java.lang.Thread.run(Thread.java:613)

      This exception is thrown because RendererUtils.getBooleanValue() expects HtmlSelectBooleanCheckbox.getValue() to return a Boolean but instead it returns an Object. Changing the type for the "value" attribute in h.tld as shown below avoids the exception and passes the currently failing TCK test for that component:
      <attribute>
      <description><![CDATA[The initial value of this component.]]></description>
      <name>value</name>
      <deferred-value>
      <type>boolean</type>
      </deferred-value>
      </attribute>

      Attachments

        1. MYFACES-1592.patch
          0.8 kB
          Martin Haimberger

        Activity

          People

            martin.haimberger Martin Haimberger
            pmcmahan Paul Franklin McMahan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: