tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Isaacs <Larry.Isa...@sas.com>
Subject RE: Tomcat 3.1 tag problem
Date Thu, 25 May 2000 12:43:00 GMT
Hi,
 
Your error is coming from the parser while validating the XML in web.xml.  Evidently validation
isn't occurring until taglib usage occurs.  The web.dtd contains:
 
<!ELEMENT web-app (icon?, display-name?, description?, distributable?,
context-param*, servlet*, servlet-mapping*, session-config?,
mime-mapping*, welcome-file-list?, error-page*, taglib*,
resource-ref*, security-constraint*, login-config?, security-role*,
env-entry*, ejb-ref*)>
 
Because the list following "web-app" is enclosed within parentheses, these elements MUST appear
in the specified order.  For example, if you put your "<taglib>" entry before any "<servlet>"
entries,  you could get the error you are seeing.
 
Hope this helps.
 
Larry

-----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(JspParseEventListener.java:672)

        at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.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(JspServlet.java:149)

        at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java: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(HttpConnectionHandler.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