File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retreiving String array from servlet

 
Sanjay Izardar
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[not sure]might be wrong version of el-api.jar
 
Mike Zal
Ranch Hand
Posts: 144
Fedora Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything in standard.jar that might cause a conflict with jstl.jar?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic