Bug 394147 - jstl and javascript syntax errors (misplaced construct) wrongly reported
Summary: jstl and javascript syntax errors (misplaced construct) wrongly reported
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: Web (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-12 19:24 EST by Palmer Eldritch CLA
Modified: 2013-06-19 11:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Palmer Eldritch CLA 2012-11-12 19:24:30 EST
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<head>

<script type="text/javascript">
function initArray(n) {
  this.length = n;
  for (var i =1; i <= n; i++) {
    this[i] = ' ';
  }
}
text = new initArray(4);
<c:forTokens var="token" items="${requestScope.credits}" delims=","
	varStatus="status">
<c:set var="pos" value="${fn:substringBefore((status.index/15), '.')}" />
<c:choose>
	<c:when test="${status.index%15 eq 0}"> text[<c:out
			value="${pos}" />]="<c:out value="${token}" />, "; </c:when>
	<c:otherwise> text[<c:out value="${pos}" />]=text[<c:out
			value="${pos}" />] + "<c:out value="${token}" />, " </c:otherwise>
</c:choose>
</c:forTokens>
</script>
</head>
<body></body>
</html>


Red sea of error : syntax error on token(s), misplaced construct(s)


Eclipse Java EE IDE for Web Developers.

Version: Juno Service Release 1
Build id: 20121004-1855

JavaScript Development Tools

Version: 1.4.1.v201208171701-7H7DFg0FC7sReqSyfqesWi
Build id: 20120820000423

Eclipse reports no updates when I run Help > Update check



Reproducible: Always

Steps to Reproduce:
1. Create Web Project.
2. Create JSP and paste the code above

Expected:
Jsp compiles and runs fine - not the best style but far from syntax error
Related : https://bugs.eclipse.org/bugs/show_bug.cgi?id=362891