Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax Error?

Status
Not open for further replies.

scripter73

Programmer
Apr 18, 2001
421
US
Hi,

Can't seem to find out why my compiler keeps saying I need to add a ';' in my .JSP

Here's the error message:



Generated servlet error:
[javac] Compiling 1 source file

C:\Tomcat 5.0\work\Catalina\localhost\pos-webapp\org\apache\jsp\loginProcess_jsp.java:110: ';' expected

^
1 error


Here's the code:


%@ page import="java.io.*,java.util.*
javax.servlet.*,javax.servlet.http.*"%>


<%

//Prep to setup session variables
HttpSession s = request.getSession();

......

String incorrectMsg;
if (errCode == 20100){

incorrectMsg = "Userid or Password is incorrect. Please re-enter using a valid Userid and Password.";
s.setAttribute("loginMsg",incorrectMsg);

response.sendRedirect("loginInvalid.jsp");
}
else if (errCode == 0){
incorrectMsg = "We didn't seem to find a record for you in our Database.";
s.setAttribute("loginMsg",incorrectMsg);
}
else{
response.sendRedirect("index.html");
}



The only thing I've changed is the name of the session variable. It was something like "sessLoginMessage" and I changed it to "loginMsg".

At first, I had defined String incorrectMsg inside of each section of the if loop, but then I got the same error message, and took it out.

Any help you can provide is appreciated.

Thanks,
scripter73


Change Your Thinking, Change Your Life.
 
Change :

%@ page import="java.io.*,java.util.*
javax.servlet.*,javax.servlet.http.*"%>

to :

<%@ page import="java.io.*, java.util.*" %>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top