wood burning stoves*
The moose likes JSP and the fly likes Can anybody help me to fix jsp Tag Libraray descriptor file maping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Can anybody help me to fix jsp Tag Libraray descriptor file maping" Watch "Can anybody help me to fix jsp Tag Libraray descriptor file maping" New topic
Author

Can anybody help me to fix jsp Tag Libraray descriptor file maping

Satya Komirisetti
Greenhorn

Joined: Apr 23, 2004
Posts: 11
I am being new to Jsp tag library,notunderstanding where i am making mistake.Working in WSAD 4.0.1.No compile-time error & runtime error is :JSPG0135E: No such tag example in the tag library imported with prefix etag
Tag Handler class
/* location: webApplication/WEB-INF/classes/tag/ExampleTag.class */


import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
public class ExampleTag extends TagSupport
{
public int doStartTag()
{ try{
JspWriter out = pageContext.getOut();
out.println("Hello u'r in tag example");
} catch(java.io.IOException ioe)
{System.out.println("error occured at " + ioe);}
return(SKIP_BODY);
}
}

Tag Library Descriptor File
/* location: webApplicationWEB-INF/classes/tag/taglib.tld */

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems,Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>etag</shortname>

<info> A tag library from coreservlets and jsp</info>
<tag>
<name> example</name>
<tagclass>/WEB-INF/classes/ExampleTag</tagclass>
<bodycontent>EMPTY</bodycontent>
<info> prints some text onto the screen</info>

</tag>
</taglib>
jsp file
/* location: webApplication/WEB-INF/classes/tag/tagexample.jsp */

<HTML>
<HEAD>
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet" type="text/css">
<TITLE>tagexample.jsp</TITLE>
</HEAD>
<BODY>
<%@ page language="java" %>
<%@ taglib uri="/taglib.tld" prefix="etag" %>
<H1> <etag:example/></H1>
</BODY>
</HTML>

Thank You
[ May 22, 2004: Message edited by: Satya Komirisetti ]

satya
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
Put the .tld file in WEB-INF folder.
Satya Komirisetti
Greenhorn

Joined: Apr 23, 2004
Posts: 11
I moved .tld file to WEB-INF, then also i am getting the same error
Error Message: JSPG0135E: No such tag example in the tag library imported with prefix etag
Error Code: 500
Target Servlet: null
Error Stack:
org.apache.jasper.JasperException: JSPG0135E: No such tag example in the tag library imported with prefix etag
at org.apache.jasper.compiler.TagLibraries.isUserDefinedTag(TagLibraries.java:94)
at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:781)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1089)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1040)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1036)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:236)
at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:677)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:230)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:247)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:415)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:544)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:159)
at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:286)
at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:106)
at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)
at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)
at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:499)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:278)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:105)
at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:67)
at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:123)
at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122)
at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:315)
at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:313)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:242)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)

Thanks
[ May 24, 2004: Message edited by: Satya Komirisetti ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can anybody help me to fix jsp Tag Libraray descriptor file maping