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.
create new WebApplication enable jsps compilation during build in project properties/compilation replace the code of jsp page with this code: --------------- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <c:if test="${globalData != null}" > <% Object data = pageContext.getAttribute("globalData"); %> </c:if> <c:if test="${userData != null}" > <% Object data = pageContext.getAttribute("userData"); %> </c:if> -------------- error is marked in editor - multiple variable declaration invoke build -> everythink is Ok, use run -> code si running correctly try to make the code correct as supposed by netbeans -> remove "Object" data declaration run build -> compilation error use view servlet action to see the reason of the problem: "<c:if" tag is translated into "if {" block in java and so both declarations are in different java blocks
Confirmed, unfortunately it will be quite a bit of work to fix it properly.
We had a small brainstorming session on this bug with ppisl, mfukala and jsedek and we agreed on the following: - the priority of this bug is P3 - the proper fix would require a huge rewrite in the infrastructure and there is no guarantee it would work - we will have to live with this problem in 6.5
Product Version: NetBeans IDE Dev (Build 20110411-95fa2f6ba3a6) Java: 1.6.0_23; Java HotSpot(TM) 64-Bit Server VM 19.0-b09 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) Userdir: C:\Projects\netbeans\web-main\nbbuild\testuserdir "Try to make the code correct as supposed by netbeans -> remove "Object" data declaration run build -> compilation error" - is on longer actual. It compiles fine in current version. Actually both of data variables are now located in different if blocks inside _jspService() method. The only issue left is: in editor second "data" variable should not be marked as error "is already defined in mergedScriptlets()". Actually there is no mergedScriptlets() method in jasper generated classes anymore. It looks like SimplifiedJspServlet should be rewritten accordingly to new jasper behaviour.
I do not remember the result of little brainstorming we had few years ago, but definitively this issue cannot be fixed ever :-). As the resulting java code is built in the runtime upon some external input it is not possible to correctly resolve it in the design time. The best solution to me seems to add an error fix for the errors which would allow to disable the checking for this file/folder/project.
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.