Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314385 - XML-formatted JSP validation doesn't see variables from includes
Summary: XML-formatted JSP validation doesn't see variables from includes
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.2 RC3   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-25 19:05 EDT by Nitin Dahyabhai CLA
Modified: 2010-05-27 17:36 EDT (History)
3 users (show)

See Also:
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+


Attachments
proposed patch with JUnit (12.95 KB, patch)
2010-05-25 19:05 EDT, Nitin Dahyabhai CLA
no flags Details | Diff
supplemental patch (1.07 KB, patch)
2010-05-27 12:35 EDT, Nitin Dahyabhai CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.