Hi ,
I am running JRun 2.3.3 on IIS4.0. I am facing a unique problem
I create a session object in a Servlet LoginServlet ( after the user has
successfully logged in ). This servlet redirects the user
to a "MainJSP.jsp" page. This page contains links to various JSP pages. When a
user enters every JSP page, this session object is checked for existance ( and
if it exists then the user is allowed to view the contents of that particular
page, else he will be kicked back to the LoginServlet ).
I am being shown error1.html page if i keep the browser window inactive for
more than 10 seconds.... In the Jrun admin i have set the session tracking
variables for more than 1 hour...
The way i go about doing it is as follows....
LoginServlet :
-------------------
public void service( HttpServletRequest req, HttpServletResponse resp)
throws ServletException , IOException
{
// if user has successfully loggedin, then create a ssession object.....
Technician tech = new Technician() ;
tech.setLoggedOn(true);
tech.setName(loginBean.getUser() ) ;
tech.setUserType(loginBean.getUserType() ) ;
// Put the Session back.. into the server
// Set the current user info for the session.
session.setMaxInactiveInterval(3600); // 1 hour
session.putValue(Constants.TECHNICIAN,tech);
resp.sendRedirect( "/MainJSP.jsp") ;
}
SessionCheckJSP.jsp // checks whether a session has already been created, and
the user hasa valid login or not....
---------------------------------
<%
Technician tech = (Technician)session.getValue(Constants.TECHNICIAN);
if(tech == null) // no Technician ever exists
{
%>
<jsp:forward page="/error1.html" /> // redirect user to the Error page
1
<% } else if(! tech.isLoggedOn() ) // user tried to access a jsp page
illegally
{
%>
<jsp:forward page="/error2.html" /> // redirect user to the Error page
2
<% } else
{
session.putValue(Constants.TECHNICIAN,tech); // return the object back
to the Hash Table
}
%>
MainJSP.jsp
-------------------
<%@ include file="/SessionCheckJSP.jsp" %>
<jsp:include page="/LocObjectsJSP.jsp" flush="true"/>
<html>
<head>
<title>Telecom Technician Main Page</title>
</head>
<frameset framespacing="0" border="0" rows="57,*" frameborder="0">
<frame name="banner" scrolling="no" noresize target="contents" src="top.htm">
<frameset cols="164,*">
<frame name="contents" target="main" src="MenuJSP.jsp" scrolling="auto">
<frame name="main" target="_top" src="WelcomeJSP.jsp" scrolling="auto">
</frameset>
<noframes>
<body>
<p>This page uses frames, but your browser doesn't support them.</p>
</body>
</noframes>
</frameset>
</html>
MenuJSP.jsp
-------------------
<%@ include file="/SessionCheckJSP.jsp" %>
<html>
<body>
<table border="0">
<tr>
<td width="100%"><a href="SelectWorkJSP.jsp"><img border="0"
src="/telecom/images/select.gif" width="108" height="25"></a></td>
</tr>
</body>
</html>
SelectWorkJSP.jsp
------------------------------
<%@ include file="/SessionCheckJSP.jsp" %>
.... some other jsp stuff..................
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html