Hi everyone I am SEAN MENEZES .I am working on JSP,Java beans ,JDBC,MYSQL,LINUX.I am checking the session for login on every page if not logged on i am diverting user to login page from where he is diverted to a standard page after he correctly logs in which is hard coded but i want to divert him to the page from where he originally came to login page .how do i do it please help very urgent and imp Sean menezes Dhamm infotech Sean_menezes@yahoo.com
Here is one option, I'm sure it's not the best, but at the beginning of every page include the following: <%@ include file="loginCheck.jsp" %> This page will check the session to see if the person has logged in, and if not redirect them to the login page. In addition to redirecting te person, you could also get the URL of the page that the person is on and store that in the session: StringBuffer currentPage = HttpUtils.getRequestURL(request); session.setAtrtibute("currentPage", currentPage); Now in your login page, after a successfull login, check to see if there is a value in currentPage from which to erdirect the uesr back to: Stringbuffer redirectPage = (StringBuffer)session.getAttribute("currentPage"); Hope that helps Brian
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.