Two Laptop Bag
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
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

Joined: Jul 29, 2008
Posts: 3924

<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.

Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Prakash Dewangan

Joined: Jan 21, 2011
Posts: 5
Please use

I agree. Here's the link:
subject: JSTL how to use ELSE in JSP
It's not a secret anymore!