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 129938 - Erronoeous errors in Javascript parsing in JSP
Summary: Erronoeous errors in Javascript parsing in JSP
Status: VERIFIED WORKSFORME
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks: 121950 135023
  Show dependency tree
 
Reported: 2008-03-12 17:19 UTC by kvgeorge1
Modified: 2008-09-11 13:22 UTC (History)
3 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 kvgeorge1 2008-03-12 17:19:08 UTC
I have the following code snippet from a JSP that I am working on:

            var MAX_RECORDS = <bean:write name="maxRecords"/>;

This produces a "SYNTAX ERROR" with no other explaination.  I believe this to be that the JS parser does not handle 
setting a variable to a value that is generated from a STRUTS TAG that is not surrounded by quotes.  I need this value 
to be numeric, not a string.

I can surround this with an eval() statement and the error goes away, I just don't think that it should be required 
since the JSP gets compiled just fine and the source is correct without errors in the page.
Comment 1 Petr Hejl 2008-04-05 13:09:27 UTC
Once this "syntax error" appears it travels to last edited line (on save).
Comment 2 dcherk 2008-04-30 16:47:24 UTC
Another example, this time using JSTL:
	function passAll() {
		for( i = 0; i < <c:out value='${resultSize}'/>; i++ ) {
			document.getElementById( 'hasSucceeded_' + i ).selectedIndex = 1;
		}
	}
Syntax errors galore!
Comment 3 Tomas Mysik 2008-06-12 08:16:20 UTC
I tried the last example and I can see errors - but these errors are JavaScript errors, no JSP parser error.
Please evaluate, thanks.
(I hope I selected the correct component.)

Product Version: NetBeans IDE Dev (Build 080610)
Java: 1.5.0_15; Java HotSpot(TM) Client VM 1.5.0_15-b04
System: Linux version 2.6.25-gentoo-r4 running on i386; UTF-8; cs_CZ (nb)
Comment 4 Torbjorn Norbye 2008-09-08 19:56:27 UTC
Both of these code snippets appear to work now. I just fixed two other bugs in the same area (JavaScript embedding in
JSP) - issue 133173 and issue 133469. It's possible that this bug was fixed by one of those two bug fixes. If you can
reproduce the issue, please attach a code sample.
Comment 5 Tomas Mysik 2008-09-09 16:05:07 UTC
No errors anywhere.

Product Version: NetBeans IDE Dev (Build 080905)
Java: 1.5.0_16; Java HotSpot(TM) Client VM 1.5.0_16-b02
System: Linux version 2.6.26-gentoo-r1 running on i386; UTF-8; cs_CZ (nb)
Comment 6 Jindrich Sedek 2008-09-11 13:22:52 UTC
verified.
NetBeans IDE Dev (Build 20080911010625)