aspose file tools
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

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Conditional logic in JSF" Watch "Conditional logic in JSF" New topic

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

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

Rodrigo Lazoti.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16887

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.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: Conditional logic in JSF
It's not a secret anymore!