i would advise that u utilize
jsp session. here's one example
put this in every page
========================================================================
<% //<!--
//response.setHeader("Cache-Control","no-cache"); //Forces caches to obtain a new copy of the page from the origin server
//response.setHeader("Cache-Control","no-store"); //Directs caches not to store the page under any circumstance
//response.setDateHeader("Expires", 0); //Causes the proxy cache to see the page as "stale"
response.setHeader("Pragma","no-cache"); //HTTP 1.0 backward compatibility
String userNameSess = (String) session.getAttribute("theName");
String urlR = request.getRequestURI();//saves the url that the user logs in but yet validated by the system
if (null == userNameSess) {
request.setAttribute("Error", "Session has ended. Please login.");//also applies to unvalidate user
request.setAttribute("url",urlR);//set url so that the page loads back to the previous page after re-login
RequestDispatcher rd = request.getRequestDispatcher("loginAgain.jsp");
rd.forward(request, response);
}
========================================================================
and in the login page, u shud have this...
========================================================================
String url = (String) request.getAttribute("url");
input type="hidden" name="url" value="<%=url%>
========================================================================
and finally in the login check page (the page where you posted the login name and password for validation)
========================================================================
String url =request.getParameter ("url");
//and after you have validate the user, do this
response.sendRedirect(url);
=========================================================================
you can combine step 2 and 3 in the same page if you validate the user in the same page.
hope it answer your question
[ February 07, 2006: Message edited by: samart mateo ]