• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Dan Acuff
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I tried putting it all in one <c:if> statement but it failed to work like the above code.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our JSP forum since it is about EL.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You can use the and operator to combine the two. What did you try that didn't work?
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What did it look like when you combined them? Everything must be within the brackets.

Also, don't you have to use $ instead of #...?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's JSF notation -- moved to the JSF forum.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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:



 
Dan Acuff
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic