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

Bug 82333

Summary: Taglibs referenced in included files aren't loaded
Product: [WebTools] WTP Source Editing Reporter: Nitin Dahyabhai <thatnitind>
Component: jst.jspAssignee: Nitin Dahyabhai <thatnitind>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: david_williams, gunnar, jeff, jochen.riedlinger, loskutov, thogau
Version: 0.7.1   
Target Milestone: 1.0 M7.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch to handle simple /-starting cases none

Description Nitin Dahyabhai CLA 2005-01-06 11:39:32 EST
WTP 1.0M2 build

JSP files included in another file using the JSP include directive don't have
their taglib directives processed by the JSP source editor.  The
TLDCMDocumentManager methods for handling include methods require updating to
both the new model baseLocation sematics and the new TaglibIndex.
Comment 1 Nitin Dahyabhai CLA 2005-01-19 15:51:01 EST
Fixed in HEAD
Comment 2 Nitin Dahyabhai CLA 2005-02-04 13:28:33 EST
*** Bug 84425 has been marked as a duplicate of this bug. ***
Comment 3 thogau CLA 2005-02-27 03:52:29 EST
(In reply to comment #1)
> Fixed in HEAD

I just updated to 1.0M3 but I am still unable to use auto-completion for taglibs
included with the  : <%@ include file="/xxxx.jsp"%>

However auto-completion works just fine in the file xxxx.jsp itself.

Shouldn't this type of inclusions be supported by Eclipse?
Comment 4 Nitin Dahyabhai CLA 2005-02-27 06:49:14 EST
Yes, where is "/" referring to, the root of the project?
Comment 5 thogau CLA 2005-02-28 03:57:49 EST
The "/" is not referring to the root of my project.
I am using appfuse (https://appfuse.dev.java.net/) and the directory structure
doesn't allow me to have my project recognized as a real Eclipse J2EE web
project. Do you think this can be the reason?
If not, here are relevant info concerning my directory structure:

- web pages are under /web

- the .jsp page including taglib declarations is : /web/common/pages
(auto-completion is working in this file).

- I have /web/common/header.jsp. In the top of this file I have : <%@ include
file="/common/taglibs.jsp"%> and I can not have completion working in this file.
I have tried to replace with :
<%@ include file="taglibs.jsp"%> (relative)
or
<%@ include file="/common/taglibs.jsp"%> (absolute from project root directory)
but it doesn't work either. 
Comment 6 thogau CLA 2005-02-28 04:02:56 EST
I am Sorry there was a typo in the previous comment :
- the .jsp page including taglib declarations is : /web/common/taglibs.jsp 
Comment 7 David Williams CLA 2005-06-15 01:32:55 EDT
Changed Version field given new release numbering.
Comment 8 Nitin Dahyabhai CLA 2005-07-06 18:25:07 EDT
Yes, that's probably the reason.  The definition of "/" depends on the project
being one of our flexible Java projects.  Otherwise it's assumed to be the
parent of the WEB-INF folder that is found in one of the .jsp file's parent folders.
Comment 9 yaochunlin CLA 2005-07-19 22:03:11 EDT
This bug is not resolved

/WebContent/common/taglibs.jsp

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>


/WebContent/main/index.jsp

<%@ page language="java" contentType="text/html; charset=utf-8" 
pageEncoding="utf-8" %>
<%@include file="/common/taglibs.jsp" %>

However auto-completion works just fine in the file taglibs.jsp itself.


Comment 10 Nitin Dahyabhai CLA 2005-07-27 02:59:21 EDT
Inside of TLDCMDocumentManager.DirectiveStructuredRegionHandler.processInclude,
the URIHelper used to normalize the included file URI into a path is returning
references starting with "/" as-is instead of making it relative to the supplied
root path.
Comment 11 Nitin Dahyabhai CLA 2005-07-27 13:11:27 EDT
*** Bug 104981 has been marked as a duplicate of this bug. ***
Comment 12 Nitin Dahyabhai CLA 2005-07-27 18:09:56 EDT
Created attachment 25385 [details]
patch to handle simple /-starting cases
Comment 13 Nitin Dahyabhai CLA 2005-08-02 16:25:34 EDT
Patch committed to HEAD.  Hopefully this is the last piece before we truly
support flexible modules.
Comment 14 Nitin Dahyabhai CLA 2005-08-05 04:05:13 EDT
*** Bug 106115 has been marked as a duplicate of this bug. ***
Comment 15 Nitin Dahyabhai CLA 2005-09-06 06:35:45 EDT
Approved in 9/1/2005 telecon for 0.7.1.  Patch applied to maintenance branch.
Comment 16 David Williams CLA 2005-09-20 15:27:16 EDT
We've just noticed this had mistakenly not been released to 0.7.1 build yet. 
Expect to see in M builds > 9/20
Comment 17 Jochen Riedlinger CLA 2005-10-27 05:33:10 EDT
it is still not fixed in 1.0M8.

if I have a jsp which include a fragment with the taglib-directives like this:

[...]
<%@ include file="/common/jstl_1.1_taglibs.jspf" %>
[...]

where the file "jstl_1.1_taglibs.jspf" lokks like:

<%@ taglib uri="/WEB-INF/tlds/jstl/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tlds/jstl/fmt.tld" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tlds/jstl/fn.tld" prefix="fn" %>
<%@ taglib uri="/WEB-INF/tlds/jstl/x.tld" prefix="x" %>


but if I include the jsp fragment like:
<%@ include file="../common/jstl_1.1_taglibs.jspf" %>

verything works fine.

So was the "/"-Patch for the injclude of a jspf which has the taglib directives 
inside or the uri attribute in the taglib element?
Comment 18 Nitin Dahyabhai CLA 2005-12-13 17:06:12 EST
The patch addressed locating the included file itself.

The parent folder of WEB-INF is what we currently consider as '/'.
Comment 19 Nitin Dahyabhai CLA 2006-06-21 17:37:19 EDT
Verified in WTP 1.5 RC5a
Comment 20 Nitin Dahyabhai CLA 2006-06-29 14:27:30 EDT
Closing