This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass value to ManagedBean in Facelet

 
John Storta Jr.
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently converting my old JSP pages to JSF 2.0 facelets. So far I am very impressed with the framework. I am running into an issue on one thing.

I have a bean that I use to load assorted stylesheets based on what browser is being used, the theme and the specific section of the site. This bean provides a list of stylesheets and those are added to the page as <LINK>s

Here is the original code.

This works great. Now I am trying to convert this to the facelet and I am running into some problems locating the functionality that I need.


This is what I have so far in my facelet.

This also works great, except in my original code I am also passing values to the bean before I generate the list. I cannot find a way to pass values to the managedbean from within the facelet.

All of the references I have found online refer to setting managedproperties in an xml file, but I need to be able to set the properties from the facelet page since the values will be different for each page.

Is there some equivalent to the <jsp:setProperty> tag in Facelets?

I am not sure if this is not possible in JSF 2.0 facelets or if I am just not looking in the right place.

Thanks
 
C Bell
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello John,
Try using the jstl tag set, http://java.sun.com/javaee/javaserverfaces/2.0/docs/pdldocs/facelets/c/set.html, to replace your jsp:setProperty.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic