Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35344

Re: Syntax error on token "taskTEList", VariableDeclaratorId expected after this token

X-Received by 10.237.34.178 with SMTP id p47mr18549024qtc.23.1471204206398; Sun, 14 Aug 2016 12:50:06 -0700 (PDT)
X-Received by 10.157.41.230 with SMTP id g35mr1129197otd.19.1471204206363; Sun, 14 Aug 2016 12:50:06 -0700 (PDT)
Path csiph.com!xmission!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!c52no8790836qte.1!news-out.google.com!d130ni35371ith.0!nntp.google.com!f6no9954359ith.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Sun, 14 Aug 2016 12:50:05 -0700 (PDT)
In-Reply-To <nop34r$1f19$1@gioia.aioe.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=199.16.140.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
NNTP-Posting-Host 199.16.140.29
References <nop34r$1f19$1@gioia.aioe.org>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <e8a2d0eb-fa7e-4b69-aeb8-dc915632ee97@googlegroups.com> (permalink)
Subject Re: Syntax error on token "taskTEList", VariableDeclaratorId expected after this token
From Lew <lewbloch@gmail.com>
Injection-Date Sun, 14 Aug 2016 19:50:06 +0000
Content-Type text/plain; charset=UTF-8
Lines 36
Xref csiph.com comp.lang.java.programmer:35344

Show key headers only | View raw


parmenides wrote:
> Hi,
> 
> In a JSP page, the following code:
> 
> <%
> ...
> ArrayList<TaskTableEntry> taskTEList;
> @SuppressWarnings("unchecked")
> taskTEList = (ArrayList<TaskTableEntry>)session.getAttribute("taskTEList");
> ...
> %>
> 
> will result in compilling error:
> 
> Syntax error on token "taskTEList", VariableDeclaratorId expected after 
> this token

The annotation is in an illegal place. You cannot annotate a statement, only a declaration.

> 
> But, by modifing the code as:
> 
> <%
> ...
> @SuppressWarnings("unchecked")
> ArrayList<TaskTableEntry> taskTEList = 
> (ArrayList<TaskTableEntry>)session.getAttribute("taskTEList");
> ...
> %>
> 
> there is no the above error message at all. Why?

Because here you annotate the declaration.

-- 
Lew

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Syntax error on token "taskTEList", VariableDeclaratorId expected after this token parmenides <xparmenides@yahoo.com> - 2016-08-14 14:29 +0800
  Re: Syntax error on token "taskTEList", VariableDeclaratorId expected after this token Lew <lewbloch@gmail.com> - 2016-08-14 12:50 -0700

csiph-web