*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL how to use ELSE in JSP" Watch "JSTL how to use ELSE in JSP" New topic
Author

JSTL how to use ELSE in JSP

Ramesh Kumar Swarnkar
Ranch Hand

Joined: Sep 15, 2003
Posts: 84
Hi,
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,
Ramesh
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3019
    
  35

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

Joined: Jan 21, 2011
Posts: 5
Please use

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JSTL how to use ELSE in JSP
 
Similar Threads
Problem with nested c:forEach
jstl and tiles
JSTL if statement does not work
Doubt in Attribute with JSTL.Thanks!
How can I c:set an int in my JSP?