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.

Bug 227312 - JSP parse error when defining JS var after %>
Summary: JSP parse error when defining JS var after %>
Status: RESOLVED DUPLICATE of bug 225442
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP Parser (show other bugs)
Version: 7.3
Hardware: All All
: P2 normal (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-11 19:22 UTC by ccsheng
Modified: 2013-03-26 11:17 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ccsheng 2013-03-11 19:22:56 UTC
Overview:
Within the <script> block of a JSP file, if there are any JavaScript variable declaration added after "%>", the JSP is marked with a red error badge. On mouse-over the file name the tooltip shows "Error parsing file".

Steps to reproduce:
1. Create a new JSP file within a project.
2. Add a <script> block.
3. Within the <script> block add a scriptlet with:
<%
    if (true)
    {
%>var i = 0;
alert(i);
<%
    }
%>
4. Save the file.
5. Notice the red error badge on the file. Sometimes the editor window will also display a warning annotation on the "var" line.

Workaround:
Move "var" declaration to a new line (i.e. press ENTER after %>) and the parse error goes away upon save. I discovered this issue and workaround when reformatting a few JSP files but it may not be feasible to do so on a large web project (large number of JSP files).

Expected result:
There should not be any parsing error as it is not necessary to have a new line after %>.
Comment 1 Vladimir Riha 2013-03-12 07:21:12 UTC
Works fine in trunk, no error badge. Maybe fixed by issue 225738 or issue 225442?


Product Version: NetBeans IDE Dev (Build 201303102300)
Java: 1.7.0_15; Java HotSpot(TM) Client VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b03
System: Linux version 3.2.0-38-generic-pae running on i386; UTF-8; en_US (nb)
Comment 2 Martin Fousek 2013-03-26 11:17:10 UTC
Vlada is right, this issue is related to the issue #225442. Will be fixed in the patch1 of the NetBeans 7.3.

*** This bug has been marked as a duplicate of bug 225442 ***