Created attachment 25065 [details] emptyTagWithAttribute_Xml.jspx Steps to reproduce: 1. Place the attached emptyTagWithAttribute_Xml.jspx into webapps/examples 2. Open http://localhost:8080/examples/emptyTagWithAttribute_Xml.jspx 3. Observe error 500: org.apache.jasper.JasperException: /emptyTagWithAttribute_Xml.jspx(6,18) According to TLD, tag my:shuffle must be empty, but is not org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88) org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.java:216) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239) org.apache.jasper.compiler.ParserController.parse(ParserController.java:103) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:170) org.apache.jasper.compiler.Compiler.compile(Compiler.java:332) org.apache.jasper.compiler.Compiler.compile(Compiler.java:312) org.apache.jasper.compiler.Compiler.compile(Compiler.java:299) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) The above stack trace is with 6.0.25 release candidate. IIRC, I observed the same with 6.0.24 recently. It works correctly with TC 6.0.20. This issue affects JSP Documents (XML syntax) only. The pages in plain JSP syntax (e.g. shuffle.jsp in our examples) work correctly.
Created attachment 25066 [details] emptyTagWithAttribute_Jsp.jsp The same page in plain JSP syntax. It works.
It is a regression in the fix for bug47977. Looking at a fix now...
Fixed in trunk (with a couple of test cases) and proposed for 6.0.x
Fixed in 6.0 in r919354 and will be in 6.0.26 onwards. I tested the current 5.5 (that will be 5.5.29) and it is not affected by this issue.
Created attachment 25736 [details] emptyTagWithSpaceAndComment_Xml.jspx One more regression due to bug47977 fix: If the empty tag contains a comment, Tomcat barks that "tag .. must be empty but is not". I am attaching a JSPX document that reproduces this issue. The steps to reproduce are the same as in Description of this issue. Reproducible in 6.0.28 and in the current trunk (thus released 7.0.0-beta is also affected). I tested 5.5.30 as well and it works correctly.
I have review the EBNF in the JSP 2.2 spec and I can't see anything that would permit comments in a tag that should have an empty body.