Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365197 - [validation] JSP+EL+JS: Syntax error, insert "}" to complete Block
Summary: [validation] JSP+EL+JS: Syntax error, insert "}" to complete Block
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-30 09:18 EST by Victor Homyakov CLA
Modified: 2013-07-23 11:39 EDT (History)
1 user (show)

See Also:


Attachments
JSP example (411 bytes, text/plain)
2011-11-30 09:20 EST, Victor Homyakov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.