GeeCON Prague 2014*
The moose likes JSP and the fly likes JSTL-C    using  c:choose problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL-C    using  c:choose problem" Watch "JSTL-C    using  c:choose problem" New topic
Author

JSTL-C using c:choose problem

Prasad Tirumareddi
Greenhorn

Joined: Feb 17, 2005
Posts: 7
Hi ,

I am using jstl1.1 and i want to use the choose .

I am doing this
<c:choose>
<c:when test="true"> I am from true </c:choose>
<c therwise> I am from False </c therwise>
</c:choose>

I am using Jdeveloper 10g 10.1.3 Developer Preview Version relase and
running it from the embedded OC4J server.

When i run it i get the following error .....

500 Internal Server Error

javax.servlet.jsp.JspTagException: Illegal use of <when>-style tag without <choose> as its direct parent
at org.apache.taglibs.standard.tag.common.core.WhenTagSupport.doStartTag(WhenTagSupport.java:94)
at _cTest_2e_jsp._jspService(cTest.jsp:26)
[/cTest.jsp]
at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:343)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:543)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:441)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:61)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:672)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:378)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:869)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.run(HttpRequestHandler.java:288)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].server.http.HttpRequestHandler.run(HttpRequestHandler.java:120)
at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) - Developer Preview 3].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:299)
at java.lang.Thread.run(Thread.java:534)



Does anyone faced this problem.
Your help is greatly appreciated.


Thanks in advance,
Prasad.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61305
    
  66

Look at your tag matching carefully.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Prasad Tirumareddi
Greenhorn

Joined: Feb 17, 2005
Posts: 7
Hi,

I am using it exactly like this. The tags are matched perfectly.

<c:choose>
<c:when test="${selectedIndex == 1}">
I am 1
</c:when>
<c therwise>
i am rest
</c therwise>
</c:choose>

But i am getting the same error posted above.

Can anyone help me in this.

Thanks,
Prasad.
Eugene Lucash
Ranch Hand

Joined: Feb 19, 2005
Posts: 77
Try another jsp / servlet container. your example seems to be correct
Prasad Tirumareddi
Greenhorn

Joined: Feb 17, 2005
Posts: 7
Hi,

I have tested with Tomcat and it runs. When i do the same with OC4J it shows me the error. What could be the problem. We have to deploy the applcation in OC4j . How can i comeover this problem.


Thanks,
Prasad.
 
GeeCON Prague 2014
 
subject: JSTL-C using c:choose problem