Two Laptop Bag*
The moose likes JSF and the fly likes How can I add expression  some code in XHTML (under faceletes)? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How can I add expression  some code in XHTML (under faceletes)?" Watch "How can I add expression  some code in XHTML (under faceletes)?" New topic
Author

How can I add expression some code in XHTML (under faceletes)?

Mark Kafe
Ranch Hand

Joined: Jun 23, 2008
Posts: 60

How can I add expression some code in XHTML (under faceletes)?


i want to use expression in my xhtmls pages under facelets

With Facelets which builds JSF UI tree in pure xhtml (without scriptlets like JSP : <%=...%>) its true can we not use scriptlets like JSP

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

JSF is an MVC architecture. Thus, the Model, the View, and the Controller are 3 separate entities, each with its own specific purpose. For the most part this means that logic has no place in the View. The exception being mostly simple EL used in "rendered" attributes.

Even where you can use scriptlets in JSF, it's bad design. It's not even very good design in JSP - I've been helping someone out who can make hardly any sense of his project because half the program logic or more is in JSPs polluting the HTML instead of being in Java classes.


Customer surveys are for companies who didn't pay proper attention to begin with.
Mark Kafe
Ranch Hand

Joined: Jun 23, 2008
Posts: 60

yaaa i know this all.........but we have problems in tab switching thats why we want tu use some scriptlets........
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15957
    
  19

If you're using the RichFaces tabs, you wouldn't use scriptlets anyway - and I'm not. The RichFaces tabs can be selected server-side via an Action or client-side via JavaScript.
 
Don't get me started about those stupid light bulbs.
 
subject: How can I add expression some code in XHTML (under faceletes)?
 
Similar Threads
How to use RichFaces in "normal" JSF
Facelets
Need help in xhtml files
Does someone know Facelest?
is it need to use verbatim to enclosed all non-jsf tag?