File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Can I combine the 2 <c:if> EL expressions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Can I combine the 2 <c:if> EL expressions?" Watch "Can I combine the 2 <c:if> EL expressions?" New topic
Author

Can I combine the 2 <c:if> EL expressions?

Dan Acuff
Ranch Hand

Joined: Jul 13, 2009
Posts: 62


I tried putting it all in one <c:if> statement but it failed to work like the above code.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

Moving to our JSP forum since it is about EL.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30309
    
150

Yes. You can use the and operator to combine the two. What did you try that didn't work?
Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 273

What did it look like when you combined them? Everything must be within the brackets.

Also, don't you have to use $ instead of #...?


SCJP 6 || SCWCD 5
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61001
    
  65

That's JSF notation -- moved to the JSF forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20



JSTL and JSF are a bad mix. Keep it all JSF whenever possible.

However, as far as it goes, putting logic in a View is not recommended.

Better:




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

Joined: Jul 13, 2009
Posts: 62
Thank you very much Tim.

I got rid of the JSTL tags in favor of the render attributes.

I still plan on going into the java class and getting it to work that way.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can I combine the 2 <c:if> EL expressions?