Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

please help in this tag problem

 
Abhra Kar
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tag class:-

package foo;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.IOException;
public class SimpleTagTest1 extends SimpleTagSupport{

public void doTag()throws JspException,IOException{
getJspContext().getOut().print("This is the lamest use of a custom tag");
}
}

Simple.tld under WEB_INF:-

<?xml version="1.0" encoding="UTF-8" ?>
<taglib>

<tlib-version>1.2</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>mine</short-name>

<uri>simpleTags</uri>


<tag>
<name>simple1</name>
<tag-class>foo.SimpleTagTest1</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>

call.jsp:-

<%@ taglib uri="simpleTags" prefix="mine" %>
<html><body>
<mine:simple1/>
</body></html>

servlet-api.jar and jsp-api.jsr is properly been set.

Please help me in this case
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the problem?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't duplicate threads. I've removed the other one.

Tell us more about your problem. What is it ?
 
Abhra Kar
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to run this program by http://localhost:7777/ctd5/call.jsp ,where "ctd5" is the web application ,it gives the error "javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver"
 
ShaikSalam Bashoeb
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Abhra Kar, I don't have much idea about the code. But for running the jstl we need more two jar files i.e., jstl.jar and standard.jar.

If you have not included these jar files then try by includig these jar files
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which web container are you using ? Which version ?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver

That means you're using a JSP version that requires Servlet API 2.5/JSP 2.1. Tomcat 6 is a servlet container that supports that, but not Tomcat 5 or earlier.
[ December 18, 2008: Message edited by: Ulf Dittmer ]
 
Abhra Kar
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using tomcat version 6
 
Abhra Kar
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question to Mr.ShaikSalam Bashoeb

Sir, Here I haven't use any jstl code. So why i will put the jstl.jar and standard.jar files into
WEB_INF\lib in my web application?
 
Abhra Kar
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still haven't solved .
 
Oren Ben
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should add the "jsp-api.jar" to your CLASSPATH
 
Ranjit Gopinathan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax/el/ELResolver is inside el-api.jar .

Check if the lib folder of tomcat directory is having this jar.


-HTH

SORRRY!!! Did not check the date before posting!
 
chan set
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just put the el-api.jar jsp.jar and servlet-api.jar into java/jre/lib/ext/

(if you to lazy/ or confuse to set the path)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic