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.
dev build 200208020100 It was recently 'revealed' to me <grumble> <grumble> that JSP requires special quoting for <% %>, quotes and slash characters. For example, the following: <jsp:setProperty name="counter" property="appBase" value="<%= application.getRealPath(\"\") %>" /> is correct but Netbeans flags the \" (escape character) as being incorrect. Personally I wish JSPs would work the way Netbeans seems to assume it does, but unfortunately it does not. Please see the JSP specification, section JSP.2.6
Correction: <jsp:setProperty name="counter" property="appBase" value="<%= application.getRealPath(\"\") %>" /> was incorrect as <% and %> were not escaped properly. Let me clarify the purpose of this bug report.. I want Netbeans' syntax highlighting to point out to users that special escaping is required inside quotes and if they don't escape those characters the syntax highlighting will flag it as an error.
Further correction: Aparently one only need to escape *nested* characters. For example if you have: <jsp:setProperty ... value="<something>"/> then you only need to escape any quotes found in <something> if however you have: value="<%= \"<something>\" %>" then you only need to escape characters if <%, %> or quotes are found inside something. <% becomes <\% and %> becomes %\> (but only if nested inside a parent <% %> block). I for one am very confused as to the actual interpretation of the specification. I wish quoting wasn't necessary at all (I see no real reason for it anyway). Could someone please clarify the exact meaning behind JSP.2.6? and/or reasoning :) Thanks, Gili
This issue is still valid for Promo-D: According to the JSP 2.0 spec the quotes in attributes must be quoted even inside JSP scriptlets, declarations or expressions. So the following valid code is marked as invalid - the first backslash is colored as an error: <x:tag value="<%= \"hi!\" %>" /> This is issue is caused because of we do use common java syntax parser for the jsp scriptlets content. For java code the code _is_ really invalid - but not for JSP scriptlet. Fixing this would require having a hacked own version of the java syntax parser for JSP parsing - it is not so much elegant and IMO not worth of the result.
*** Issue 21908 has been marked as a duplicate of this issue. ***
Not easy fix (see my last comments) together with disputable asset - will not be fixed now.
not critical I think
NetBeans.org Migration: changing resolution from LATER to WONTFIX