[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?

