[help!] Syntax error, insert "AssignmentOperator ArrayInitializer"...

...

<%

String USERNAME = (String)session.getAttribute("USERNAME");

String myBlogUrl;

if (USERNAME==null){

session.setAttribute("loginStatus","Not Logged In");//status: user NOT logged in

myBlogUrl ="loginFail.jsp";

}

esle{

myBlogUrl ="blog.jsp?username="+USERNAME;

}

%>

<ul>

<li><a href="<%=myBlogUrl%>">My Blog</a></li>

...

(navbar.jsp)

1. I includemasthead.jsp andnavbar.jsp in a few other .jsp files using:

<%@ include file="include/navbar.jsp" %>

2. USERNAME is also declared inmasthead.jsp:

String USERNAME = (String)session.getAttribute("USERNAME");

Tomcatgives an exception message as follows:

--

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 11 in the jsp file: /include/navbar.jsp

Generated servlet error:

Syntax error, insert ";" to complete Statement

An error occurred at line: 11 in the jsp file: /include/navbar.jsp

Generated servlet error:

Syntax error, insert "AssignmentOperator ArrayInitializer"to complete ArrayInitializerAssignement

3. I guesses there might be the problem with String USERNAME = (String)session.getAttribute("USERNAME");

, so I deleted fromnavbar.jsp, but the problem still exists.

So, this means there is some syntax problem with the statements innavbar.jsp? how can I solve the problem?

[2011 byte] By [Zaiminga] at [2007-11-26 15:04:25]
# 1

Can't see anything wrong in the code you have posted.

Error: AssignmentOperator ArrayInitializer

The error message would lead me to look for any arrays you are declaring in your code. Are you declaring an array? Are you trying to initialize it? Have you closed all quotes/brackets etc etc?

evnafetsa at 2007-7-8 8:54:05 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
What I put here is the only JSP scripting elements in navbar.jsp. All the rest are just normal html codes.I haven't declared any array.
Zaiminga at 2007-7-8 8:54:05 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...