wood burning stoves*
The moose likes JSP and the fly likes Error regarding the JSTL tag application. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Error regarding the JSTL tag application." Watch "Error regarding the JSTL tag application." New topic
Author

Error regarding the JSTL tag application.

Keerthi Kumar
Ranch Hand

Joined: Apr 20, 2009
Posts: 105
Hi all,

I am trying to execute a simple application using JSTL tags. But got stuck up due to the below mentioned error/exception Please find the error description below:

exception

javax.servlet.ServletException: javax/el/ValueExpression
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.jstl.demo.JstlDemoServlet.doPost(JstlDemoServlet.java:18)
com.jstl.demo.JstlDemoServlet.doGet(JstlDemoServlet.java:23)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
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(Unknown Source)
java.lang.Class.getDeclaredMethods(Unknown Source)
java.beans.Introspector$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.beans.Introspector.getPublicDeclaredMethods(Unknown Source)
java.beans.Introspector.getTargetMethodInfo(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
java.beans.Introspector.<init>(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
java.beans.Introspector.<init>(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3678)
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2100)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1579)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3270)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.jstl.demo.JstlDemoServlet.doPost(JstlDemoServlet.java:18)
com.jstl.demo.JstlDemoServlet.doGet(JstlDemoServlet.java:23)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


This is my servlet:

package com.jstl.demo;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class JstlDemoServlet extends HttpServlet
{
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
String[] movieList = {"Peaceflu Warrior","Apacolypto","Fearless","Perfume"};
request.setAttribute("movieList", movieList);
RequestDispatcher view = request.getRequestDispatcher("/MovieList.jsp");
view.forward(request, response);
}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
doPost(request, response);
}
}

This is my jsp:

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<body>
<strong>Movie List : </strong>



<c:forEach var="movies" items="${movieList}"> </c:forEach>
${movies}

</body>
</html>

Following are the 3 jar files include in the application:

1. standard.jar
2. jstl.jar
3. jstl-1.2.jar

This is my xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>
JstlDemo</display-name>
<servlet>
<description>
</description>
<display-name>
JstlDemoServlet</display-name>
<servlet-name>JstlDemoServlet</servlet-name>
<servlet-class>
com.jstl.demo.JstlDemoServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JstlDemoServlet</servlet-name>
<url-pattern>/JstlDemoServlet</url-pattern>
</servlet-mapping>

</web-app>


Awaiting your positive response !! Thanks in Advance





Cheers,
Keerthi Kumar N
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Please UseCodeTags.

Did you follow the directions in the JSP FAQ for installing the JSTL?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Keerthi Kumar
Ranch Hand

Joined: Apr 20, 2009
Posts: 105
Hi,

Thanks for your reply. But I didnt get what you were telling about that steps to be followed for the JSTL installation. Can you please elaborate a bit on the same?

Please do the needful. Thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

It's all covered in the JSP FAQ. I'm not going to repeat it here -- that's what FAQs for for,.
 
 
subject: Error regarding the JSTL tag application.
 
Similar Threads
Getting Problem in display tag with struts
java.lang.NoClassDefFoundError: javax/el/ValueExpression
Problem While using Java Mail API....
ServletException: UnhandledException
using the display:table tag