This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes JSTL how to use ELSE in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL how to use ELSE in JSP" Watch "JSTL how to use ELSE in JSP" New topic

JSTL how to use ELSE in JSP

Ramesh Kumar Swarnkar
Ranch Hand

Joined: Sep 15, 2003
Posts: 84
I am using the <c:if .. statement in my JSP for if-condition check; but not sure the how to use the ELSE from the tag library. I could not see any such tag which supprt 'ELSE'.
I simply try using ><c:else> the jsps stops working and nothign displays on screen.

If any one already aware how to use ELSE here - please share with me.
THanks in advance,
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3013

<c:if> doesn't support that. Instead, you can use <c:choose>, which has a <c:otherwise> part that gets invoked if no criteria was matched.

Founder of ExamLab and Systemup
See how I can help you to become an awesome programmer
Prakash Dewangan

Joined: Jan 21, 2011
Posts: 5
Please use

wood burning stoves
subject: JSTL how to use ELSE in JSP
Similar Threads
Problem with nested c:forEach
Doubt in Attribute with JSTL.Thanks!
JSTL if statement does not work
jstl and tiles
How can I c:set an int in my JSP?