Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314385

Summary: XML-formatted JSP validation doesn't see variables from includes
Product: [WebTools] WTP Source Editing Reporter: Nitin Dahyabhai <thatnitind>
Component: jst.jspAssignee: Nitin Dahyabhai <thatnitind>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: major    
Priority: P3 CC: david_williams, nsand.dev, raghunathan.srinivasan
Version: 3.1Flags: david_williams: pmc_approved+
thatnitind: pmc_approved? (raghunathan.srinivasan)
thatnitind: pmc_approved? (naci.dai)
deboer: pmc_approved+
thatnitind: pmc_approved? (neil.hauge)
thatnitind: pmc_approved? (kaloyan)
nsand.dev: review+
Target Milestone: 3.2 RC3   
Hardware: All   
OS: All   
Whiteboard: PMC_approved
Attachments:
Description Flags
proposed patch with JUnit
none
supplemental patch none

Description Nitin Dahyabhai CLA 2010-05-25 19:05:14 EDT
Created attachment 169914 [details]
proposed patch with JUnit

Forked from bug 119576 because of reproducible test case in attachment 163156 [details].  The original bug was about the <%@include%> syntax, which has been working fine for some time.  This is about the use of <jsp:directive.include/> .
Comment 1 Nick Sandonato CLA 2010-05-26 11:18:45 EDT
Looks good to me.
Comment 2 Nitin Dahyabhai CLA 2010-05-26 13:23:07 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

XML-formatted JSP files don't have their included fragments considered during JSP-Java validation.  Any variables declared in fragments or added through the use of custom tags will trigger validation errors on access.

* Is there a work-around? If so, why do you believe the work-around is insufficient? 

None.

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?

Manual testing, plus included JUnit for both include syntaxes. 

* Give a brief technical overview. Who has reviewed this fix? 

Java scriptlets/expressions/declarations within JSP fragments where the includer uses the XML syntax are skipped when creating our Servlet translation, specifically because it doesn't consider the XML syntax valid for further processing.  Reviewed by Nick.

* What is the risk associated with this fix? 

Low.  Takes out a restriction on the syntax that prevented the handling of include and page directives when written as XML.
Comment 3 Nitin Dahyabhai CLA 2010-05-26 21:58:36 EDT
Releasing.
Comment 4 Nitin Dahyabhai CLA 2010-05-27 12:35:26 EDT
Created attachment 170219 [details]
supplemental patch

The original fix exposed a duplicate handling of custom tags, in terms of adding variables declared by their TEI class, in the processIncludeDirective() method.  As removing the invocation corrects the failures in the UI test suite without breaking any of the existing tests in the Core suite, I'd prefer to apply it rather than rollback the original patch.
Comment 5 Nitin Dahyabhai CLA 2010-05-27 12:36:14 EDT
Reopening for re-review.
Comment 6 David Williams CLA 2010-05-27 12:52:36 EDT
I'm fine with completing the fix. Seems an important area to "get right". 

thanks,
Comment 7 Nick Sandonato CLA 2010-05-27 13:14:06 EDT
Update looks fine. Thanks for addressing it quickly.
Comment 8 Nitin Dahyabhai CLA 2010-05-27 13:31:57 EDT
Rereleasing on +1/-0.