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.
Testing: NB 6.0M10 included Tomcat 6 Issue occurs: Empty web project created. Existing web project "imported" Issue: Page B is a simple JSP file named b.jsp. <% String MYTEST = "OK" ; %> Page A is a simple JSP Page named A.jsp that INCLUDES Page B. <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@include file="b.jsp" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>JSP Page</h1> <%= MYTEST %> .... rest of file In the NB 6M10 IDE, any reference to information contained in the included file (using either the include directive or jsp:include model) results in an error condition: cannot find symbol symbol: variableMYTEST location: class SimplifiedJSPServlet The issue makes working with JSP pages very difficult as each page indicates numerous errors depending on the inclusion requirements. The files compile fine under NB6M10 and deploy fine under the included Tomcat 6 instance. The issues seems to lie with the editor-coding model. (For comparison: The include works fine in NB 5.5.1.)
The generated virtual servlet file provided to java infrastructure likely doesn't take the inclusion into account.
Confirmed. The scenario you described should be definitely handled properly but I don't think we can fix the opposite situation (where B is referring to objects defined in A) /is it legal at all?/. We should also define the behavior in case the included file contains compilation errors. Note that we had no support for showing compilation errors in JSP scriptlets prior to 6.0.
Excuse me, There is some idea of how to fix it? In version 5.5, used much this feature, therefore, I believe that this is of extreme importance to the users of NetBeans. Tks,
Fixed in trunk. Checking in SimplifiedJSPServlet.java; /cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/SimplifiedJSPServlet.java,v <-- SimplifiedJSPServlet.java new revision: 1.25; previous revision: 1.24 done
*** Issue 121065 has been marked as a duplicate of this issue. ***
Thank you for the hard work. However, I do not believe this issue is resolved. Using NetBeans 6.0 200711021200 Assume the following: /index.jsp ---> a root level file /res/all.jsp ---> the file to be included /somesubdirectory/myapp.jsp ----> a subdirectory jsp file Now, if index.jsp includes /res/all.jsp, the issue reported does appear to be resolved. <%@include file="/res/all.jsp" %> HOWEVER, if /somesubdirectory/myapp.jsp includes /res/all.jsp, THE ISSUE REMAINS. That is, the fix does not appear to apply when including the common file from a subdirectory. <%@include file="../res/all.jsp" %> I tested this again this morning, and the IDE does not 'see' the include file in the latter situation. The IDE reports numerous errors in the 'calling' file (ex. myapp.jsp) just as before when referencing any common elements in the intended include file (all.jsp).
I didn't imagine org.openide.filesystems.FileObject would not handle '../' in relative paths.. I am now using java.io.File, the problem has been resolved. /cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/SimplifiedJSPServlet.java,v <-- SimplifiedJSPServlet.java new revision: 1.34; previous revision: 1.33
*** Issue 148606 has been marked as a duplicate of this issue. ***
verified Product Version: NetBeans IDE Dev (Build 200811011401) Java: 1.6.0_10-rc2; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.24-21-generic running on i386; UTF-8; en_US (nb)