wood burning stoves 2.0*
The moose likes JSP and the fly likes retreiving String array from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "retreiving String array from servlet" Watch "retreiving String array from servlet" New topic
Author

retreiving String array from servlet

Sanjay Izardar
Greenhorn

Joined: Apr 18, 2011
Posts: 19
i have a servlet file

1) BeanTest.java



and a jsp file

2) result2.jsp



i put the files in the following locations
1)BeanTest.class(webapps\myApp\WEB-INF\classes)
2)result2.jsp(webapps\myApp)
3)jstl.jar(webapps\myApp\WEB-INF\lib)
4)standard.jar(webapps\myApp\WEB-INF\lib)

and i am using jsp2.0 servlet 2.4 and tomcat 5.5

by running the files i am getting this error
exception

javax.servlet.ServletException: javax/el/ValueExpression
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
BeanTest.doPost(BeanTest.java:13)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NoClassDefFoundError: javax/el/ValueExpression
java.lang.Class.getDeclaredMethods0(Native Method)
java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
java.lang.Class.getDeclaredMethods(Class.java:1791)
.
.
.

how to solve this?
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

I think you are using jstl1.1 and search the jar which has javax/el/ValueExpression ;add it to the classpath. probably you need to add el-api.jar
Sanjay Izardar
Greenhorn

Joined: Apr 18, 2011
Posts: 19
thanks Seetharaman,
yes i am using jstl 1.1.
i added el-api.jar in lib folder, but now i'm getting this error.

exception

org.apache.jasper.JasperException: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
BeanTest.doPost(BeanTest.java:13)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

javax.servlet.ServletException: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.result2_jsp._jspService(result2_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
BeanTest.doPost(BeanTest.java:13)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
javax.servlet.jsp.jstl.core.LoopTagSupport.unExposeVariables(LoopTagSupport.java:620)
javax.servlet.jsp.jstl.core.LoopTagSupport.doFinally(LoopTagSupport.java:354)
org.apache.jsp.result2_jsp._jspx_meth_c_forEach_0(result2_jsp.java:109)
....

how can i get rid of from this problem.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

[not sure]might be wrong version of el-api.jar
Mike Zal
Ranch Hand

Joined: May 04, 2011
Posts: 144

Is there anything in standard.jar that might cause a conflict with jstl.jar?


OCJP6, OCWCD5
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

You're all barking up the wrong tree.

The javax.el package has nothing whatsoever to do with the JSTL -- it's part of the EL, which is part of JSP.

The javadoc for this class shows that it was added with JSP 2.1.

So the question is, if you are using Tomcat 5, which supports JSP 2.0, how is something trying to reference a JSP 2.1 class which will exist only in Tomcat 6?

The answer:
i added el-api.jar in lib folder, but now i'm getting this error.


In other words, you have completely screwed up JSP and your Tomcat installation by copying jars that you should not be mucking around with. Remove that jar and start over. All you're doing is making a bigger mess.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: retreiving String array from servlet
 
Similar Threads
Error regarding the JSTL tag application.
can't run jstl in jsp
Jstl error
JSTL does not show values
help-standard tag c:forEach practice