Bug 44637 - JspValueExpression.getType() returns Object.class instead of correct Type
Summary: JspValueExpression.getType() returns Object.class instead of correct Type
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Servlet & JSP API (show other bugs)
Version: 6.0.16
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2008-03-19 10:36 UTC by Michael Heß
Modified: 2008-04-02 03:11 UTC (History)
0 users

Eclipse Project that shows the problem. (362.52 KB, application/x-gzip)
2008-03-19 10:36 UTC, Michael Heß
WAR File with blank JARs (3.09 KB, application/x-gzip)
2008-03-31 04:17 UTC, Michael Heß

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Heß 2008-03-19 10:36:21 UTC
Created attachment 21690 [details]
Eclipse Project that shows the problem.

Problem manifests when using converter-for-class strategy within a JSF application.

I tested JSF RI 1.2.0 as well as My Faces 1.2.2.

A converter is mapped for a BackingBean class. The first symptom I noticed was the converters getAsObject() method not being called. I investigated further, and tracked it down to a call to JspValueExpression that both RI and MyFaces make:

(_SharedRendererUtils: Line 58)
Class valueType = expression.getType(facesContext.getELContext());

In my case this call always returns Object.class as valueType, leading to the converter not being called.

I have attached an eclipse workspace that includes a simple demo of the problem. I have left out the MyFaces Libs, so to make the example work please grab a copy of the libs on the myfaces site.
Comment 1 Mark Thomas 2008-03-23 18:11:29 UTC
My build environment isn't compatible with the Eclipse project you have attached. Please can you build the war and attached that. Note: you can leave out the MyFaces libs if necessary and I can add them manually.
Comment 2 Michael Heß 2008-03-31 04:14:15 UTC
Sorry for the delay, I was on vacation last week.

I'll attach the war as requested. Let me know if you need further infos or having further problems recreating the behaviour.
Comment 3 Michael Heß 2008-03-31 04:17:56 UTC
Created attachment 21740 [details]
WAR File with blank JARs

I left the JARs as 0-byte files in WEB-INF/lib. Just replace them with the corresponding files.
Comment 4 Mark Thomas 2008-04-01 16:28:18 UTC
I have traced this call and, as far as I can tell, the Tomcat code is just a thin veneer around some more MyFaces code - specifcialy org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getType()

I can't see anything obviously wrong with what Tomcat is passing back so at the moment this looks like a MyFaces issue.

I am no JSF expert so if the MyFaces folks say this is a Tomcat issue I am more than prepared to believe them but I am going to need some clear pointers to where Tomcat isn't behaving in order to look into any fix.

I am marking this as invalid whilst the my faces folks look at it. Feel free to re-open this it it is found to be a Tomcat bug.
Comment 5 Michael Heß 2008-04-02 03:11:25 UTC
I don't know the inner workings between EL and JSF that well. But it least it gives me a hint where to look next. I'm closing this bug.

Thanks for looking into this for me, Mark.