- This topic has 11 replies, 5 voices, and was last updated 14 years, 3 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
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.
Riyad KallaMemberCan you post an example of a JSP page I can copy/paste on my end over here to reproduce the problem?
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; %> -->
Riyad KallaMemberI reproduced this easily, I will file it for investigation.
GoekhanMemberIs there any news on this issue?
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)
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?
Riyad KallaMemberNot at this time unfortunately.
plthomasMemberFound an easy work-around…move the variable declarations outside the HTML comments. Only declarations in HTML comments hit this bug.
Riyad KallaMemberAhh very cool, thanks for posting that for other folks.
NolanVariableMemberYea that worked for me
its gotta be outside those html brackets
-
AuthorPosts