Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356983 - Custom tag hyperlink opens included JSP file.
Summary: Custom tag hyperlink opens included JSP file.
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.3.2   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-07 13:57 EDT by Iwao AVE! CLA
Modified: 2011-11-14 19:24 EST (History)
1 user (show)

See Also:
nsand.dev: review+


Attachments
Fix hyperlink of custom tag file with include directive (1.92 KB, patch)
2011-09-07 14:02 EDT, Iwao AVE! CLA
nsand.dev: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Iwao AVE! CLA 2011-09-07 13:57:22 EDT
Build Identifier: 20110615-0604

When a custom tag includes other JSP file using the 'include' directive, hyperlink of the custom tag opens the included JSP file instead of the custom tag file.

This happens because the location string of the custom tag is overwritten in the following method during processing the included JSP file.
org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD.loadTagFile(CMElementDeclarationImpl, IFile, boolean, InputStream)


Reproducible: Always

Steps to Reproduce:
1. Create a JSP file 'taglibs.jsp' in the webapp root directory.
<%@ taglib tagdir="/WEB-INF/tags" prefix="tags" %>

2. Create a custom tag file 'myfunc.tag' with the following line and place it into the /WEB-INF/tags directory.
<%@ include file="/taglibs.jsp" %>

3. Create another JSP file with the following line.
<tags:myfunc />

4. Command (or Control) + Click the custom tag to open myfunc.tag.

Expected:
myfunc.tag is opened.

Actual:
taglibs.jsp is opened.
Comment 1 Iwao AVE! CLA 2011-09-07 14:02:54 EDT
Created attachment 202924 [details]
Fix hyperlink of custom tag file with include directive

The patch modifies the following methods (I haven't tested .tagx file, but it seems to be the same).

org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD.loadTagFile(CMElementDeclarationImpl, IFile, boolean, InputStream)

org.eclipse.jst.jsp.core.internal.contentmodel.tld.CMDocumentFactoryTLD.loadTagXFile(CMElementDeclarationImpl, IFile, boolean, InputStream)
Comment 2 Nick Sandonato CLA 2011-09-07 15:29:12 EDT
Thanks for the patch! I think it looks pretty good. We're pretty late into SR1 right now, so I'll target it for SR2.
Comment 3 Nick Sandonato CLA 2011-11-14 16:46:32 EST
Code checked in. Thanks again!
Comment 4 Iwao AVE! CLA 2011-11-14 19:24:06 EST
Thank you for the review and the commit. :)