Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365197

Summary: [validation] JSP+EL+JS: Syntax error, insert "}" to complete Block
Product: [WebTools] JSDT Reporter: Victor Homyakov <vkhomyackov>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 CC: jpadilla
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
JSP example none

Description Victor Homyakov CLA 2011-11-30 09:18:46 EST
Build Identifier: 20110916-0149

Sometimes when using JSP with EL expressions and valid inline JavaScript, JavaScript validator produces false validation error: Syntax error, insert "}" to complete Block.

Reproducible: Always

Steps to Reproduce:
1. Create JSP with following content:
<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<input type="button" value="Print" onclick="ShortCardView.printByPid(${card.pid});" />
<c:choose>
  <c:when test="${param.dontwait==null}">
  </c:when>
  <c:otherwise>
    <script type="text/javascript">window.onload=function(){window.print();window.close();};</script>
  </c:otherwise>
</c:choose>
2. Validate file.

There should be no errors but JavaScript validator shows error on the line 8 at semicolon before "</script>". Error disappears if I remove the 3rd line ("<input />" tag with EL expression).

I've installed also the latest maintenance build of WTP (wtp-M-3.3.2-20111117045640.zip) which fixes other annoying JSP+EL bugs - it did not help.
Comment 1 Victor Homyakov CLA 2011-11-30 09:20:39 EST
Created attachment 207723 [details]
JSP example
Comment 2 Jorge Padilla CLA 2013-07-23 11:39:15 EDT
Hi Victor, 

I tried to recreate this bug with the latest driver (JSDT Version: 1.5.1.v201307161720-7H7FFhVFC7sResSxfpflai) and I can't see the problem. If this is still a problem, could you provide current instructions to recreate it?  Otherwise, I'll recommend Chris Jaun to close this as fixed.

Thanks.