Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 109721 - JSP editor does not find taglib directives in include-prelude or jsp:include
Summary: JSP editor does not find taglib directives in include-prelude or jsp:include
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: 0.7   Edit
Hardware: PC Windows XP
: P2 major with 3 votes (vote)
Target Milestone: 2.0 RC0   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 124288
  Show dependency tree
 
Reported: 2005-09-16 05:47 EDT by Wolfgang Gehner CLA
Modified: 2007-06-22 15:56 EDT (History)
2 users (show)

See Also:


Attachments
initial test implementation (46.06 KB, patch)
2007-03-29 02:26 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 Wolfgang Gehner CLA 2005-09-16 05:47:12 EDT
We use the official 2.4 construct "include-prelude" to prefix all jsp's with a
shared jspf that includes all taglib directives. (kind of like <jsp:include
page="/taglibs"/>, but without having to provide it in the jsp.
The jsp editor does take these taglib directives into account and thus fails to
compile and code-complete jsp tags.
This bug is severe because it means we would be back to having directives in
very single jsp, most painful to change directives in large apps with 400 jsps
like we have.

This is valid 2.4 web-xml:
<jsp-config>
   <jsp-property-group>
      <display-name>taglibs</display-name>
      <url-pattern>*.jsp</url-pattern>
      <include-prelude>/taglibs.jspf</include-prelude>
   </jsp-property-group>
</jsp-config>
Comment 1 David Williams CLA 2005-09-20 17:53:09 EDT
Nitin, please evaluate .. is this related to the other fix we just released today?
Comment 2 Nitin Dahyabhai CLA 2005-09-20 19:33:12 EDT
No, this is unrelated.  It appears to be a part of Servlet 2.4 / JSP 2.0 that we
don't yet support, like the content type values that declare new name patterns
for JSP files.
Comment 3 Nitin Dahyabhai CLA 2005-09-20 19:34:02 EDT
CCing David since I'm not sure he got the notice for my previous comment.
Comment 4 David Williams CLA 2005-09-20 20:20:42 EDT
Of course, thanks Nitin, I'm skim reading too much. 

Wolfgang, this does sound important, so we'll evaluate for 1.0. 
I'm changing version to .7, since its supposed to be either the version 
reporter was using when found, or the verison its fixed in. We'll update 
this bugzilla as we update and prioritize to see if it can fit in M9, but 
won't plan to fix on .7 base. 
Comment 5 Naci Dai CLA 2005-10-06 14:36:17 EDT
Is this related to the bug with defining taglib directive in an include file and
jsp editor cannot recognize the taglibs in the inclusing jsp?

<@ include file="mytaglibs.jsp" %>

<c:out ...

Comment 6 Nitin Dahyabhai CLA 2005-10-31 15:30:32 EST
Naci, no, it has to do with new abilities in the deployment descriptor, not
anything within the JSP source itself.
Comment 7 Arun Joseph CLA 2006-01-30 11:25:32 EST
(In reply to comment #6)
> Naci, no, it has to do with new abilities in the deployment descriptor, not
> anything within the JSP source itself.

Nitin,
Does this mean that i would be able to get content assist for methods defined in my include files ("<%@include file") from my JSP ?
This doesn't seem to be working for me.

Thanks,
Arun
Comment 8 Nitin Dahyabhai CLA 2006-02-23 02:42:32 EST
(In reply to comment #7)
> Does this mean that i would be able to get content assist for methods defined
> in my include files ("<%@include file") from my JSP ?
> This doesn't seem to be working for me.

Yes, although there's another bug having to do with the internal translation being assembled incorrectly when fragments are involved.  Content Assist may not return the correct proposals in that case.  Phil, has that bug been corrected in 1.5?
Comment 9 Phillip Avery CLA 2006-02-23 09:23:02 EST
Yes that problem is fixed.
Example files where it's not working?
Comment 10 Nitin Dahyabhai CLA 2007-03-29 02:26:05 EDT
Created attachment 62351 [details]
initial test implementation

The attached patch implements a DeploymentDescriptorPropertyCache to keep the key values of a web.xml's jsp-config property-groups available in memory (as a soft referenced set of objects based on the web.xml's workspace path) for Java translation and the content model.  For now the include-coda files are ignored by the tag content model but included in the Java translation, and I have yet to evaluate the performance impact.  I'm also not sure about adding yet another resource change listener into the jsp.core plugin--even if they're all POST_CHANGE we're up to 4 with this addition.
Comment 11 Nitin Dahyabhai CLA 2007-04-10 02:22:27 EDT
Released for RC0.
Comment 12 gamerson CLA 2007-06-13 16:48:23 EDT
The solution for this bug only takes into account the first jsp-property-group element.  For web.xml files that have multiple jsp-property-groups, the jsp editor won't honor all elements, just the first.  Since I can't reopen this bug I've added a new one here: bug#191483
Comment 13 Amy Wu CLA 2007-06-22 15:56:46 EDT
verified in wtp2.0 RC4 200706212235