• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL Tags Problem

 
lokesh pushpa
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai JavaLovers,

I have a problem when i am using JSTL If else-if tags i.e <c:if><c:choose><c:when><c:otherwise>tags
Problem: I need to use two if conditions and then else condition, is it possible to use in JSTL. If any one know please send me the Syntax,

Previously they are using, 2 <c:if> conditions and checking the conditions.
Now i want to display 2 <c:if>condition along with else condition as per my requirement.

Please suggest me.... And please excuse me if anything wrong in my English.

Thanks
Lokesh
 
Jesus Angeles
Ranch Hand
Posts: 2069
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way is to use negation.

Add 'not ' in your expression.

Thereby, you have 2 if's in sequence, one is for true, the other for not true.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesus Angeles wrote:Thereby, you have 2 if's in sequence, one is for true, the other for not true.

That is not a good way to approach the problem.

According to the scant information in the post, I see no reason why the <c:choose>, <c:when> and <c:otherwise> constructs cannot be used.

Is there something about the conditions that makes this difficult? If so, what?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!