This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Bartender
Posts: 18662
71
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
Bartender
Posts: 18662
71
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!