• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Saloon Keeper
Posts: 28469
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic