Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329750 - Cannot find tag library descriptor if the tld is in another mapped folder
Summary: Cannot find tag library descriptor if the tld is in another mapped folder
Status: VERIFIED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 3.2.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Rakesh CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 05:19 EST by Mauro Molinari CLA
Modified: 2011-03-02 17:59 EST (History)
3 users (show)

See Also:
nsand.dev: review+


Attachments
ZIP file containing a project that shows the problem (6.12 KB, application/zip)
2010-11-09 05:20 EST, Mauro Molinari CLA
no flags Details
patch (1.13 KB, patch)
2010-11-10 04:29 EST, Rakesh CLA
nsand.dev: iplog+
Details | Diff
project demonstrating failure to resolve jsp tag files (1.98 KB, application/x-gzip)
2011-03-02 15:47 EST, David Mansfield CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Molinari CLA 2010-11-09 05:19:09 EST
Suppose you have a Dynamic Web Project with two folders mapped in the Web Deployment Assembly page (WebContent and WebContent2).

Suppose you have taglib1.tld in WebContent/taglib/ and taglib2.tld in WebContent2/taglib/. Now suppose your web.xml (in WebContent/WEB-INF) says the following:

<jsp-config>
  <taglib>
    <taglib-uri>http://uri1</taglib-uri>
    <taglib-location>/taglib/taglib1.tld</taglib-location>
  </taglib>
		
  <taglib>
    <taglib-uri>http://uri2</taglib-uri>
    <taglib-location>/taglib/taglib2.tld</taglib-location>
  </taglib>
</jsp-config>

Then, try to write a JSP in WebContent/ with the following:

<%@ taglib prefix="taglib1" uri="http://uri1" %>
<%@ taglib prefix="taglib2" uri="http://uri2" %>

The JSP editor returns an error on the second line, saying: 
Can not find the tag library descriptor for "http://uri2"

However, it should be able to correctly find the tld for both the URIs, since they are in two web application deployed folders, although the second one is in a folder different from that of web.xml and the JSP.

I'm going to attach a ZIP containing a project that shows this problem.
Comment 1 Mauro Molinari CLA 2010-11-09 05:20:46 EST
Created attachment 182691 [details]
ZIP file containing a project that shows the problem
Comment 2 Rakesh CLA 2010-11-09 07:30:18 EST
I am looking into  Bug 229760 which is in similar area.I will look into this problem.
Comment 3 Rakesh CLA 2010-11-10 04:29:30 EST
Created attachment 182793 [details]
patch

Resolving path with the help of FacetModuleCoreSupport.
Comment 4 Nick Sandonato CLA 2010-11-12 15:18:12 EST
Patch looks good. Thanks, Rakesh.
Comment 5 David Mansfield CLA 2011-03-02 09:14:21 EST
has this patch been tested for jsp tag files (in /WEB-INF/tags).  the bug description and discussion concerns only TLD files.
Comment 6 Mauro Molinari CLA 2011-03-02 09:27:30 EST
(In reply to comment #5)
> has this patch been tested for jsp tag files (in /WEB-INF/tags).  the bug
> description and discussion concerns only TLD files.

Sorry, I haven't tested yet, however this should be in WTP 3.2.3 (Helios SR2), released some days ago, so you may try and let us know.
Comment 7 Mauro Molinari CLA 2011-03-02 09:31:31 EST
For me, the fix is ok (I verified it with my use case).
Comment 8 David Mansfield CLA 2011-03-02 10:17:02 EST
yes.  it works in a simple test case, but doesn't work for me in reality.

my projects were created many many moons (literally because of the eclipse version naming ;-) ago and possibly there's some version number that's keeping this from working.

thanks for your help.  if i figure this out i'll post back.
Comment 9 Mauro Molinari CLA 2011-03-02 11:02:43 EST
I would suggest you to create an empty new workspace and import your projects in the new workspace. In this way your should have a clean environment to test with. If the problem still occurs, the best would be to find out a simple test case to attach here or (even better) in a new bug report.

Note: in my tests, I saw that, after opening a JSP which showed the red marker on the taglib directive before the fix, I had to press the right mouse button on the editor and choose "Validate" in order to make sure that the error and warning markers were refreshed. In this way, the red marker on the taglib directive correctly disappeared.
Comment 10 Nitin Dahyabhai CLA 2011-03-02 13:52:31 EST
(In reply to comment #9)
> I would suggest you to create an empty new workspace and import your projects
> in the new workspace. In this way your should have a clean environment to test
> with. If the problem still occurs, the best would be to find out a simple test
> case to attach here or (even better) in a new bug report.
> 
> Note: in my tests, I saw that, after opening a JSP which showed the red marker
> on the taglib directive before the fix, I had to press the right mouse button
> on the editor and choose "Validate" in order to make sure that the error and
> warning markers were refreshed. In this way, the red marker on the taglib
> directive correctly disappeared.

Clearing the .metadata/.plugins/org.eclipse.jst.jsp.core/taglibindex directory in the existing workspace, while Eclipse is _not_ running, will do just as well.
Comment 11 Nitin Dahyabhai CLA 2011-03-02 13:56:10 EST
(In reply to comment #10)

Oh, as should closing and reopening your projects, at lest the ones with the tag libraries in them.
Comment 12 David Mansfield CLA 2011-03-02 15:45:48 EST
i have a test case that isn't working.  it's a tar.gz of a workspace I just created with a project not working.

there are two "deployment assemblies" /web and /built/web

/built/web/WEB-INF/tags contains foo.tag

/web/departmentGroup/addEdit/addEditForm.jsp contains a reference to the tag which cannot be resolved (in fact the directory /WEB-INF/tags is red).  There's also a Test.java for good measure ;-)

I'll attach in a sec...
Comment 13 David Mansfield CLA 2011-03-02 15:47:53 EST
Created attachment 190201 [details]
project demonstrating failure to resolve jsp tag files

i tried to attach a workspace but it's too large.  i believe this project can be imported into a fresh workspace and it'll show the problem.
Comment 14 Nitin Dahyabhai CLA 2011-03-02 17:59:59 EST
Opened bug 338751 specifically for tag file case.  David, your example project was VERY helpful in tracking it down.