You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Paul McMahan (JIRA)" <de...@myfaces.apache.org> on 2007/04/23 15:45:15 UTC

[jira] Created: (MYFACES-1592) cannot render selectBooleanCheckbox tag when a boolean value is supplied

cannot render selectBooleanCheckbox tag when a boolean value is supplied
------------------------------------------------------------------------

                 Key: MYFACES-1592
                 URL: https://issues.apache.org/jira/browse/MYFACES-1592
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-252
    Affects Versions: 1.2.0-SNAPSHOT
            Reporter: Paul McMahan


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>



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (MYFACES-1592) cannot render selectBooleanCheckbox tag when a boolean value is supplied

Posted by "Paul McMahan (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul McMahan resolved MYFACES-1592.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.0-SNAPSHOT

patch applied with a minor modification, thanks Martin!

> cannot render selectBooleanCheckbox tag when a boolean value is supplied
> ------------------------------------------------------------------------
>
>                 Key: MYFACES-1592
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1592
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.0-SNAPSHOT
>            Reporter: Paul McMahan
>         Assigned To: Martin Haimberger
>             Fix For: 1.2.0-SNAPSHOT
>
>         Attachments: MYFACES-1592.patch
>
>
> 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>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-1592) cannot render selectBooleanCheckbox tag when a boolean value is supplied

Posted by "Paul McMahan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490987 ] 

Paul McMahan commented on MYFACES-1592:
---------------------------------------

Thanks Martin, I haven't looked at the RI and didn't realize that it also declares SelectBooleanCheckbox as an object.  So based on that observation I think your approach is right and will apply your patch unless there is some objection.

> cannot render selectBooleanCheckbox tag when a boolean value is supplied
> ------------------------------------------------------------------------
>
>                 Key: MYFACES-1592
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1592
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions: 1.2.0-SNAPSHOT
>            Reporter: Paul McMahan
>         Assigned To: Martin Haimberger
>         Attachments: MYFACES-1592.patch
>
>
> 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>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.