- This topic has 11 replies, 5 voices, and was last updated 14 years, 7 months ago by
NolanVariable.
-
AuthorPosts
-
GoekhanMemberI have seen a few posts about this error but it does not seem to be definitely resolved.
I imported a Web project from Eclipse 3.1/MyEclipse 4.1.0 into Eclipse 3.2/MyEclipse 5.0 Milestone 2 and some JSP files started to give “Duplicate local variable” error.
Duplicate local variable anySession.
There is no other JSP page being included in the problematic jsp page and “anySession” variable is not defined elsewhere in the page.
For testing purposes, I renamed anySession to anySession2, anySession3 etc. and rebuilt the project but to no avail.
I am using Windows XP.
Can you please help?
Thanks,
Goekhan
July 27, 2006 at 3:26 pm #255644
GoekhanMemberI just have realized that the JSP scriplets which are giving the error are enclosed by HTML comment tags:
<!–
<%
Enumeration names = null;
String name = null;
String[] values = null;
Enumeration valuesEnum = null;
%>
–>In previous versions, Eclipce(MyEclipse) used not to complain about this but now it is appearantly being flagged as an error.
July 27, 2006 at 4:17 pm #255647
Riyad KallaMemberCan you post an example of a JSP page I can copy/paste on my end over here to reproduce the problem?
July 28, 2006 at 11:58 am #255749
gabelma1MemberI’m seeing this problem too with my fresh install of Eclipse 3.2 and MyEclipse 5.0M2. The following JSP is sufficient to reproduce the error, giving “Error: Duplicate local variable i” and “Warning: The assignment to variable i has no effect”.
<!-- <% int i = 0; %> -->
July 28, 2006 at 12:43 pm #255752
Riyad KallaMemberI reproduced this easily, I will file it for investigation.
August 1, 2006 at 12:47 pm #255907
GoekhanMemberIs there any news on this issue?
August 1, 2006 at 3:08 pm #255934
Riyad KallaMemberNo update, our window for 5.0 release was too small to get this in. I had a developer investigate it very quickly and he didn’t see anything obvious. Management said if it didn’t make it in last minute into 5.0, it would go into the next service release. Sorry about that, my suggested workaround would be using server side comments or just don’t comment your scriptlets. (not the best, but a workaround)
January 19, 2007 at 9:56 am #264788
plthomasMember@support-rkalla wrote:
Sorry about that, my suggested workaround would be using server side comments or just don’t comment your scriptlets. (not the best, but a workaround)
Unfortunately, I have a situation where I have to embed scriptlet inside JavaScript — and JavaScript is always inside an HTML comment, not an server side comment.
Any progress on this issue?
January 19, 2007 at 11:06 am #264831
Riyad KallaMemberNot at this time unfortunately.
January 19, 2007 at 2:22 pm #264842
plthomasMemberFound an easy work-around…move the variable declarations outside the HTML comments. Only declarations in HTML comments hit this bug.
January 19, 2007 at 3:05 pm #264847
Riyad KallaMemberAhh very cool, thanks for posting that for other folks.
November 7, 2010 at 11:30 am #312522
NolanVariableMemberYea that worked for me
its gotta be outside those html brackets
-
AuthorPosts