because response.sendRedirect takes a string, look, copied straight from the
documentatation:

sendRedirect
public void sendRedirect(java.lang.String location)
                  throws java.io.IOException

Sends a temporary redirect response to the client using the specified
redirect location URL. This method can accept relative URLs; the servlet
container will convert the relative URL to an absolute URL before sending
the response to the client.
If the response has already been committed, this method throws an
IllegalStateException. After using this method, the response should be
considered to be committed and should not be written to.

Parameters:
location - the redirect location URL
Throws:
java.io.IOException - If an input or output exception occurs
java.lang.IllegalStateException - If the response was committed


... looks like you need to put quotes around your strings
Joseph Karau
Kingland Systems
[EMAIL PROTECTED]
507-536-3629
AIM: jkara3629


-----Original Message-----
From: sufi malak [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 27, 2001 10:49 AM
To: [EMAIL PROTECTED]
Subject: sendRedirect ??


I got this error :
A Servlet Exception Has Occurred
org.apache.jasper.JasperException: Unable to compile class for
JSP..\work\localhost\ultra2\_0002flogin_00032_0002ejsplogin2_jsp_1.java:89:
Undefined variable or class name: Insert
                response.sendRedirect(Insert.jsp);
                                      ^
..\work\localhost\ultra2\_0002flogin_00032_0002ejsplogin2_jsp_1.java:92:
Undefined variable or class name: login2
                response.sendRedirect(login2.jsp);
                                      ^
2 errors


This is my code for login2.jsp :
<%@ page import="Employee"%>
<jsp:useBean id="employee" class="Employee" scope="request"/>
<%
String  user = (String)request.getParameter("username");
String  pass = (String)request.getParameter("password");
// check the session first, if the user is in the session
sendRedirect(Insert.jsp) directly
if (user != null && pass != null)
{
if (employee.login(user, pass)){
System.out.println("user exists");
response.sendRedirect(Insert.jsp);
}
else
{
System.out.println("User does not exist");
response.sendRedirect(login2.jsp);
}
}
%>

Thanks
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to