Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internal servlet error with custom tag

Status
Not open for further replies.

darine

Programmer
Jun 23, 2000
28
0
0
US
I'm creating a very simple custom tag,and i'm getting this error:<br><br>Internal Servlet Error:<br>org.apache.jasper.JasperException: Unable to open taglibrary csajsp1-taglib.tld : D:\jakarta-tomcat\webapps\examples\jsp\csajsp1-taglib.tld (The system cannot find the file specified)<br><br>Here is the tag handler file:<br><br>import javax.sevlet.jsp.*;<br>import javax.servlet.jsp.tagext.*;<br>import java.io.*;<br><br>public class example1 extends TagSupport<br>{<br> public int doStarTag()<br> {<br> try<br> {<br> JspWriter out = pageContext.getOut();<br> out.print(&quot;Good morning !!!!&quot;);<br> }<br> catch(IOException e)<br> {<br> System.out.println(&quot;Error .....&quot;);<br> //System.out.println( e);<br><br> }<br> return (SKIP_BODY);<br> }<br><br><br>}<br><br>I'm putting that file in:<br>&nbsp;d:\jakarta-tomcat\webapps/root/web-inf/classes<br>Also here is the tag library file:<br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;<br>&lt;!DOCTYPE taglib<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PUBLIC &quot;-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN&quot;<br> &quot;<A HREF=" TARGET="_new"> a tag library descriptor --&gt;<br><br>&lt;taglib&gt;<br>&nbsp;&nbsp;&lt;!-- after this the default space is<br> &quot;<A HREF=" TARGET="_new"> A simple tab library for the examples<br>&nbsp;&nbsp;&lt;/info&gt;<br><br>&nbsp;&nbsp;&lt;tag&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;name&gt;test&lt;/name&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;tagclass&gt;example&lt;/tagclass&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;info&gt; Display JSP sources &lt;/info&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&lt;/tag&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&lt;!-- A simple Tag --&gt;<br>&nbsp;&nbsp;<br>&lt;/taglib&gt;<br><br>I'm putting it in :<br>d:\jakarta-tomcat\webapps\examples\web-inf/jsp<br><br>here is the jsp file:<br>&lt;HTML&gt;<br>&lt;HEAD&gt;<br>&lt;%@ taglib uri=&quot;csajsp1-taglib.tld&quot; prefix=&quot;csajsp1&quot; %&gt;<br>&lt;TITLE&gt;&lt;csajsp1:test /&gt;&lt;/TITLE&gt;<br>&lt;/HEAD&gt;<br>&lt;/HTML&gt;<br>i'm putting it in:<br>d:\jakarta-tomcat\webapps\examples\jsp<br><br>i will appreciate your help.<br>thanks alot<br>
 
It may be one of two things:<br>1. Does the web server require you to specify the tag library in its properties file? I'm not sure about tomcat but I know resin needs it in its properties file.<br><br>2. I think the taglib uri in the jsp file that should be<br>uri=/jsp/csajsp1-taglib.tld
 
Thanks for your time.<br>i tried that and i'm still getting the same error.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top