Summary: | JSP compilation error with nested tagfile tags with variables with "AT_BEGIN" scope | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | MicroNova YUZU Team <yuzu> |
Component: | Jasper | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P1 | ||
Version: | 5.5.27 | ||
Target Milestone: | --- | ||
Hardware: | Macintosh | ||
OS: | Mac OS X 10.4 | ||
Attachments: |
ready-to-use WAR file that reproduces the issue
patch for tc6.0.x that fixes the issue |
Description
MicroNova YUZU Team
2007-05-11 00:59:37 UTC
Created attachment 23070 [details]
ready-to-use WAR file that reproduces the issue
I have arranged the OP's sources as a ready-to-use web application - that is the WAR file that I attached above. Using it I can reproduce the problem in the following TC versions: 5.5.27, 6.0.18 and the current tc6.0.x branch as at revision 730794. Thus bumping the Version field. To reproduce: 1. Deploy the application 2. Access http://localhost:8080/bug42390/ 3. The following compilation error is displayed: (tc6.0.x) org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 99 in the generated java file _jspx_X_1 cannot be resolved ... Note: The tag file compiles fine. It is JSP that does not compile. Created attachment 23072 [details]
patch for tc6.0.x that fixes the issue
I am attaching patch that fixes the issue. It is against the tc6.0.x branch.
The cause was that scripting var info of the nested Node.CustomTag was not populated by ScriptingVariableVisitor#setScriptingVars() call.
It occurred because it thought that the variable was already declared, because it was present in ScriptingVariableVisitor#scriptVars, because the same instance of ScriptingVariableVisitor was used for the parent and child.
Again, many thanks for the patch. It has been applied to trunk and proposed for 6.0.x and 5.5.x Patch has been reverted for more testing. I have done some further testing of the patch and can't find any regressions. I have therefore re-proposed the patch for 6.0.x and 5.5.x The patch has been applied to 6.0.x and will be included in 6.0.21 onwards. Note that the patch caused bug48616. Find a solution that fixes both bugs will be tracked in bug48616. The proposed patch for 5.5.x has been updated with a fix for the regession. This issue was fixed in 5.5.x in r935941 and will be in 5.5.30 onwards. |