wood burning stoves 2.0
The moose likes JSF and the fly likes Conditional logic in JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Conditional logic in JSF" Watch "Conditional logic in JSF" New topic
Author

Conditional logic in JSF

Kalyan Anand
Ranch Hand

Joined: Feb 07, 2007
Posts: 194
I have the following code in JSF which displays a Settings URL . The URL needs to be hiiden when the parameter is null.

I was thinking about the best approach to do it. The obvious and easitest approach I see is using JSP <c:if>. Any thoughts on how this can be pertformed with other mechanisms and which one is considered better appproach ?

Kalyan Anand
Ranch Hand

Joined: Feb 07, 2007
Posts: 194
Any answers on this one ???
Rodrigo Lazoti
Greenhorn

Joined: Mar 13, 2009
Posts: 9
You're can use the rendered attribute. Example:



Rodrigo Lazoti.
blog: http://www.rodrigolazoti.com.br
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17038
    
  26

Just to be pedantic (or was that p├Ždantic?), conditional logic (meaning business logic or wholesale rearrangement of view components) is something that you should not place in a View. It's a violation of the MVC separation of concerns.

Conditional rendering, on the other hand, is another matter.


An IDE is no substitute for an Intelligent Developer.
 
Have you checked out Aspose?
 
subject: Conditional logic in JSF
 
It's not a secret anymore!