tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kc.baltz" <kc.ba...@inforonics.com>
Subject RE: Tomcat 3.1 tag problem
Date Thu, 25 May 2000 12:41:36 GMT
I just dealt with this problem yesterday and it was a real pain.  In my
case, the problem was in my web.xml.  I had written it such that each
servlet was written like this:
 
<servlet> ... servlet1...</servlet>
<servlet-mapping>...servlet1...</servlet-mapping>
<servlet> ...servlet2...</servlet>
<servlet-mapping>...servlet2...</servlet-mapping>
 
The think I had to do to fix it was rearrange these tags such that ALL the
<servlet> tags come before the first <servlet-mapping> tag.  I didn't know
that XML could create a rule like this, but two different XML validators on
the net confirmed that my web.xml was wrong.  Try yours against the
following validators:
 
 <http://www.oasis-open.org/cover/xml4j-check00.html>
http://www.oasis-open.org/cover/xml4j-check00.html
 
 <http://www.stg.brown.edu/service/xmlvalid/>
http://www.stg.brown.edu/service/xmlvalid/
 
BTW, my taglib statements all followed my <servlet-mapping> statements.  Not
sure if that mattered or not. 
 
K.C.

-----Original Message-----
From: Luc Margaron [mailto:luc.margaron@metrixsystems.com]
Sent: Thursday, May 25, 2000 3:21 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat 3.1 tag problem


Hi, 

I use Tomcat 3.1 and I cannot make the tag work 


In my web.xml I have the entry 


     <taglib> 
        <taglib-uri> http://luc/taglib <http://luc/taglib> </taglib-uri>

        <taglib-location> 
           /WEB-INF/tgld/taglib.tld 
        </taglib-location> 
    </taglib> 


I have the tag classes in /WEB-INF/classes 
  


my file taglib.tld is in /WEB-INF/tgld/taglib.tld 
  


in  Hello.jsp I have : 


<%@ taglib uri=" http://luc/taglib <http://luc/taglib> " prefix="mt" %> 
<HTML> 
<BODY> 
   <HEAD> 
       <TITLE> Hello World! </TITLE> 
   </HEAD> 
       <HR> 
           <mt:HelloWorld/> 
       <HR> 
   </BODY> 
</HTML> 
  


when I execute Hello.jsp I have the following error: 


       Location: /goodies/jsp/HelloTag.jsp 


Internal Servlet Error: 


org.apache.jasper.JasperException: Unable to open taglibrary
http://luc/taglib <http://luc/taglib>  : Parse Error in the tag library
descriptor: Element "web-app" does not allow "servlet" here. 
        at
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
ntListener.java:672) 
        at
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
ener.java:116) 
        at
org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215) 
        at org.apache.jasper.compiler.Parser.parse(Parser.java:1073) 
        at org.apache.jasper.compiler.Parser.parse(Parser.java:1038) 
        at org.apache.jasper.compiler.Parser.parse(Parser.java:1034) 
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:182) 
        at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)

        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:149) 
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va:161) 
        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261) 
        at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) 
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)

        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) 
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:160) 
        at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
) 
        at java.lang.Thread.run(Thread.java:475) 
  


If I remove the taglib entry in web.xml I get the same error 


Any idea ? 
  
  

-- 

Luc Margaron

Metrix Development

Tel   : (+33) 4 92 94 24 17

Fax   : (+33) 4 92 94 24 91
  


Mime
View raw message