jQuery in Action, 2nd edition*
The moose likes JSF and the fly likes I'm confused about variable resolving for JSF 1.2+Spring2.5+Facelets1.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "I Watch "I New topic
Author

I'm confused about variable resolving for JSF 1.2+Spring2.5+Facelets1.1

Kamila Rutkowski
Ranch Hand

Joined: Sep 22, 2009
Posts: 37
In Spring 2.5.x docs I read that for JSF 1.1 configure this resolver in faces-config.xml file as follows:



And all JSF expressions can then implicitly refer to the names of Spring-managed service layer beans, for example in property values of JSF-managed beans:


But I use JSF 1.2 and get this error:
com.sun.faces.mgbean.ManagedBeanCreationException: Unable to set property service for managed bean myJsfManagedBean

When I use this resolver:
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
I get this warning:
Class org.springframework.web.jsf.el.SpringBeanFacesELResolver must extend the type javax.el.ELResolver
and this error:
javax.faces.el.EvaluationException: java.lang.ClassCastException: java.lang.Long cannot be cast to domain.User


Could any one please help me?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15

I think you did it right the first time, but you probably didn't define a public setter named "setService" in MyJsfManagedBean with the proper parameter type. It's one of my most ocmmon JSF mistakes. Fortunately, it's easily corrected.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I'm confused about variable resolving for JSF 1.2+Spring2.5+Facelets1.1
 
Similar Threads
Integration problems using h:selectOneMenu
ejb injection in weblogic 11g fails
managed bean injection problem
JSF/Spring managing beans
Transactions in Spring + Hibernate