tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: <jsp:directive.include> and the fn tag library
Date Tue, 28 Mar 2006 19:12:03 GMT
Make sure jspf/aFragment.jspf looks something like:

<jsp:root version="2.0"
           xmlns:jsp="http://java.sun.com/JSP/Page">
[...]
${fn:length(requestScope)}
[...]
</jsp:root>

Notice that the "fn" namespace doesn't need to be redeclared.

Willy Picard wrote:
> Hi.
> 
> I have the following problem with the <jsp:directive.include> and the fn taglib:
> in a first file I have the following code:
> 
> ------------------------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
>           xmlns:c="http://java.sun.com/jsp/jstl/core"
>           xmlns:fn="http://java.sun.com/jsp/jstl/functions">
> [...]
>     <jsp:directive.include file="jspf/aFragment.jspf" />
> </jsp:root>
> ------------------------------------------------------------------------------
> 
> In the jspf/aFragment.jspf file, I have the following code:
> ------------------------------------------------------------------------------
> [...]
> ${fn:length(requestScope)}
> [...]
> ------------------------------------------------------------------------------
> 
> My web.xml may be summarized as follow:
> ------------------------------------------------------------------------------
> ------------------------------------------------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="WebApp_ID" version="2.4"
>    xmlns="http://java.sun.com/xml/ns/j2ee" 
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> [...]
> 	<jsp-config>
> 		<taglib>
> 	 	   <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
> 		    <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
> 		</taglib>
> 		<taglib>
> 	 	   <taglib-uri>http://java.sun.com/jsp/jstl/functions</taglib-uri>
> 		    <taglib-location>/WEB-INF/tld/fn.tld</taglib-location>
> 		</taglib>
> 	</jsp-config>
> 
> </web-app>
> I am using tomcat 5.5 and the JSTL 1.1 from the Taglibs project. The following
> error occurs when I call the first JSP document:
> 
> org.apache.jasper.JasperException: /WEB-INF/jspf/groupManagement.jspf(7,32) The attribute
prefix fn does not correspond to any imported tag library
> 	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
> 	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
> 	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
> 	org.apache.jasper.compiler.Validator$1FVVisitor.visit(Validator.java:1247)
> 	org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:122)
> 	org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:193)
> 	org.apache.jasper.compiler.ELNode$Visitor.visit(ELNode.java:234)
> 	org.apache.jasper.compiler.ELNode$Root.accept(ELNode.java:53)
> 	org.apache.jasper.compiler.ELNode$Nodes.visit(ELNode.java:193)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.validateFunctions(Validator.java:1266)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:607)
> 	org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:896)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:730)
> 	org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:730)
> 	org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
> 	org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:415)
> 	org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:597)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
> 	org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
> 	org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
> 	org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
> 	org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
> 	org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
> 	org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
> 	org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:640)
> 	org.apache.jasper.compiler.Node$UninterpretedTag.accept(Node.java:1185)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:409)
> 	org.apache.jasper.compiler.Node$JspRoot.accept(Node.java:525)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
> 	org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
> 	org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
> 	org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
> 	org.apache.jasper.compiler.Validator.validate(Validator.java:1489)
> 	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:157)
> 	org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
> 	org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
> 	org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
> 	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
> 	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	pl.kti.ans.servlet.ManagerServlet.gotoPage(ManagerServlet.java:83)
> 	pl.kti.ans.servlet.ManagerServlet.manage(ManagerServlet.java:76)
> 	pl.kti.ans.servlet.ManagerServlet.doPost(ManagerServlet.java:46)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 	pl.kti.ans.servlet.AuthorizationFilter.doFilter(AuthorizationFilter.java:33)
> 
> Any idea about a solution for this problem? I would just like to inform that the
> tags are correctly loaded in the first file (the code ${fn:requestScope} works
> when inserted in the first file)! Thanks in advance for your help.
> 
> Regards,
> 
> Willy Picard

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message