This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
To reproduce: 1) have a header.jspf: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2) have a following section in the web.xml: <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <include-prelude>/header.jspf</include-prelude> <include-coda>/footer.jspf</include-coda> </jsp-property-group> </jsp-config--> 3) create a .jsp like: <c:out value="XYZ"/> ERROR: the Core JSTL is not included and the <c:out... is not recognized as Core JSTL's tag. NOTE: this case should be covered by test specification and a qa-functional automated test.
The problem is located in JSP parser, PageInfo.getIncludePrelude() returns an empty list.
Reproduced, I tried to find out what is wrong - but no success. I will investigate more.
Workaround: restart IDE helps. Hopefully it is not so frequent operation to add/remove these tags.
Hello tmyslik, can you please fix this bug as soon as possible (till 09-Jun-2008), so it can be part of NB 6.1 patch 2? Thanks!
I cannot reproduce this problem on NB 6.1 patch 1 on Win XP. The example works for me...
Still reproducible on my Mac OS X, Jardo can you try to reproduce on Win platform please?
Reproducible also on Win Vista with all-updated NB6.1 ML FCS.
Just to clarify the issue: the problem is with syntax highlighting and code completion only. Compilation (including JSP files) and deployment works fine. After deployment, the page shows expected result.
IMHO this issue is not P2 because 'include-prelude' and 'include-coda' are not ignored, they are not "refreshed" after change (IDE restart helps). It's bug but still I don't think that it is so common use case. Of course, I can be wrong. I will try to look at it during this weekend.
I would say that it is some caching issue. When the IDE is restarted, it remembers the information from prelude. But if you comment it out from web.xml, it still remembers it. Closing and opening the project does not help (IDE restart helps)...
Caching issue. WebAppParseSupport.createCompilationContext uses cached options for parser (line 374): Options options = useEditor ? editorOptions : diskOptions; Options are implemented by OptionsImpl and this class caches JspConfig (constructor, line 78): jspConfig = new JspConfig(context, this); org.apache.jasper.compiler.JspConfig (from glassfish-jspparser-2.0.jar) caches results from parsing web.xml file (search for processWebDotXml method), the method is called just once, so web.xml is parsed also only once (cannot provide line numbers because I did not have sources for this file so I had to decompile). The fix may be to refresh options in WebAppParseSupport before each parsing: --- a/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java Wed Jun 04 11:40:45 2008 +0200 +++ b/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java Fri Jun 06 17:40:18 2008 +0200 @@ -374,6 +374,7 @@ Options options = useEditor ? editorOptions : diskOptions; ServletContext context = useEditor ? editorContext : diskContext; JspCompilationContext clctxt = null; + reinitOptions(); try { if (isTagFile) { clctxt = new JspCompilationContext(jspUri, null, options, context, null, rctxt, null); I tried this fix and it works for me. Tomas, please let me know if the fix is OK (any performance/other objections?) and if I can push it into trunk... Thanks!
Better diff attached: --- a/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java Wed Jun 04 11:40:45 2008 +0200 +++ b/web.jspparser/extsrc/org/netbeans/modules/web/jspparser_ext/WebAppParseSupport.java Fri Jun 06 18:00:01 2008 +0200 @@ -371,6 +371,7 @@ private synchronized JspCompilationContext createCompilationContext(FileObject jspFile, boolean useEditor) { boolean isTagFile = determineIsTagFile(jspFile); String jspUri = getJSPUri(jspFile); + reinitOptions(); Options options = useEditor ? editorOptions : diskOptions; ServletContext context = useEditor ? editorContext : diskContext; JspCompilationContext clctxt = null;
The fix is IMHO not OK because it just clears the cache *every time* - I have to find out what is wrong and then fix it. Let's discuss it more face to face. Thanks for your investigation Petr.
Fixed. http://hg.netbeans.org/main/rev/e0de9ae374ce
QA, please verify this issue till 12-Jun-2008 so it can be part of NB 6.1 patch 2. Thanks!
v.
The fix has been ported into the release61_fixes repository. http://hg.netbeans.org/release61_fixes/rev/73c1dec2758b
Integrated into 'main-golden', available in NB_Trunk_Production #251 build Changeset: http://hg.netbeans.org/main/rev/e0de9ae374ce User: Tomas Mysik <tmysik@netbeans.org> Log: #133702: Editor ignores web.xml <include-prelude> tag