JSP 2.0 tag file latest syntax doesn't work in JBoss 4.0
cjohan Jan 22, 2005 10:24 PMHere is an example tag file:
<%@ attribute name="greeting" required="true" %> <%@ attribute name="name" required="true" %> <h2><font color="black">${greeting}, ${name}!</font></h2>
I try to use the tag in a simple page, such as:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %> <html> <head><title>Tag Files Example</title></head> <body> <h1>Tage Files Example</h1> <tags:test2 greeting="Hello" name="Craig"/> </body> </html>
Deploys to JBoss 4.0.1 OK, but when accessing the above page it gets:
java.lang.RuntimeException: org.apache.jasper.JasperException: /WEB-INF/tags/test2.tagx(1,2) The markup in the document preceding the root element must be well-formed.
org.apache.jasper.compiler.ImplicitTagLibraryInfo.getTagFile(ImplicitTagLibraryInfo.java:129)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1306)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1560)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
====================
However, older style tag files do work OK, such as the following:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"> <jsp:directive.attribute name="a" type="java.lang.String" required="true"/> <jsp:directive.attribute name="b" type="java.lang.String" required="true"/> <jsp:text>A sample link: <a href="${a}"> ${b} </a></jsp:text> </jsp:root>
Does JBoss 4.0.1/Tomcat support the newer syntax? Do I need to configure something special to enable that syntax?