Hi
The code submitted below is working in Netscape 6.0 also but not in Netscape 4.76???
Herewith i am sending the example code....if i am using response.sendRedirect() in the place of <jsp:forward>? then the session variable gives a null value in the next page if i use response.sendRedirect() method.
<%@ page import="java.sql.Connection" %>
<jsp:useBean id="val" scope="request" class="Gov.Cdc.Dbmd.Lits.validatebean"/>
<%
String username = request.getParameter("username");
String password = request.getParameter("password");
//Checking the username and password is null
if(username == null || password == null || (username.trim()).length() == 0 || (password.trim()).length() == 0)
{
%>
<jsp:forward page="login.jsp">
<jsp
aram name="msg" value="1" />
</jsp:forward>
<%
}
else
{
//Check whether the Driver is already Installed in your Hard Disk.
boolean check_flag = val.checkDriver();
if(!check_flag)
{
%>
<jsp:forward page="login.jsp">
<jsp
aram name="msg" value="5" />
</jsp:forward>
<%
}
//Check whether the Database Connection created was Valid for the web user.
boolean connection_flag = val.createConnection(username.trim(),password.trim());
if(!connection_flag)
{
%>
<jsp:forward page="login.jsp">
<jsp
aram name="msg" value="4" />
</jsp:forward>
<%
}
//Check if the user id exists in the database.
int count = val.checkuser(username);
if(count == 0)//User Id does not exists
{
%>
<jsp:forward page="login.jsp">
<jsp
aram name="msg" value="1" />
</jsp:forward>
<%
}
else//User Id Exists
{
int user_status = val.getUserStatus();
if(user_status == 0)//Inactive User
{
%>
<jsp:forward page="login.jsp">
<jsp
aram name="msg" value="6" />
</jsp:forward>
<%
}
else if(user_status == 1)//Active User
{
session.setAttribute("username",username.trim());
session.setAttribute("password",password.trim());
session.setAttribute("sessionid",session.getId());
int admin_status = val.getAdminStatus();
if(admin_status == 0)//Ordinary Web User
{
%>
<!-- The Problem is here....--><jsp:forward page="linelistreport.jsp" />
<%
}
else if(admin_status == 1)//Web Admin User
{
%>
<!-- The Problem is here....--><jsp:forward page="user_settings.jsp" />
<%
}
}
}
}
%>
Hi Just now i saw one more thing....
if i am using response.sendRedirect() method then the session variable value will be lost giving null value so in next page it will automatically take me to first login page.then once again if i enter the same userid and password then now the session variable is having the values userid and password it will go the exact destination page.
what i am doing wrong in this code.can you tell me???
[ June 25, 2002: Message edited by: Kumaran Sowrirajan ]