You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Vinnie Fazio (JIRA)" <de...@myfaces.apache.org> on 2006/06/12 20:39:30 UTC

[jira] Resolved: (MYFACES-1329) Problem converting from JSF RI 1.1

     [ http://issues.apache.org/jira/browse/MYFACES-1329?page=all ]
     
Vinnie Fazio resolved MYFACES-1329:
-----------------------------------

    Resolution: Invalid

I figured out my problem. I have some managed beans that reference other manages beans through lists and maps. The JSF RI will convert these values to the managed bean type when they are assessed in JSP pages and whatnot.

MyFaces on the other hand will convert these values to String unless you specify value-class and key-class explicitly in your managed bean declaration.

I've reviewed the spec and the MyFaces version looks like it's implementation more acurately reflects the letter of the specification (section 5.3.1.3).

Lession learned...

> Problem converting from JSF RI 1.1
> ----------------------------------
>
>          Key: MYFACES-1329
>          URL: http://issues.apache.org/jira/browse/MYFACES-1329
>      Project: MyFaces Core
>         Type: Bug

>   Components: General
>     Versions: 1.1.3
>  Environment: Java5, Tomcat 5.0.28 (Servlet 2.4,  JavaServer Pages 2.0), MyFaces 1.1.3, Tomahawk 1.1.2
>     Reporter: Vinnie Fazio

>
> I'm not sure if this is the right place to post, but here goes...
> I have a JSF application that I've been working on using Sun's reference implementation 1.1.  For various reasons, I thought I'd try and upgrade to MyFaces 1.1.3.   I can get some pages to display, so I'm assuming my configuration is correct. I'm having some problems however with on page and bean in particular.  I am seeing the following exception...
> javax.servlet.ServletException: javax.servlet.jsp.JspException: Bean: java.lang.String, property: optionName
> The jsp/jsf code snippet is as follows...
> <f:subview id="main-menu">
>     <h:form>
>         <t:dataList var="option" value="#{MenuConstants.menuOptions}" layout="unorderedList">
>                 <h:commandLink action="#{option.display}">
>                      <h:outputText value="#{option.optionName}"/>
>                 </h:commandLink>
>         </t:dataList>
>     </h:form>
> </f:subview> 
> It looks like the code is getting the list correctly, but errors in converting the type.  Here is the MenuConstants get/set methods
>     public List<MenuOptionMB> getMenuOptions() {
>         return menuOptions;
>     }
>     public void setMenuOptions(List<MenuOptionMB> menuOptions) {
>         this.menuOptions = menuOptions;
>     }
> And here is the MenuOptionMB get.set for the "optionName"
>     public String getOptionName() {
>         return optionName;
>     }
>     public void setOptionName(String optionName) {
>         this.optionName = optionName;
>     }
> Shouldn't the exception have the "MenuOptionMB " class name in the bean instead of "String"???  Like I said before, this worked before using Sun's reference implementation.
> I would appreciate any help or advice.  Thanks in advance!
> Here is the full stack trace...
> javax.servlet.ServletException: javax.servlet.jsp.JspException: Bean: java.lang.String, property: optionName
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> 	at com.mycompany.ui.servlet.filter.MyFilter.doFilter(MyFilter.java:33)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> 	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> 	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
> 	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
> 	at java.lang.Thread.run(Thread.java:595)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira