Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mark Kafe
Ranch Hand
Posts: 60
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yaaa i know this all.........but we have problems in tab switching thats why we want tu use some scriptlets........
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic