myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arvind Pandey" <arvin...@datamatics.com>
Subject Session Time out problem
Date Thu, 05 Jul 2007 05:45:03 GMT

Hi all!

     My requirement is like this:

	i)  If user will try to access any direct URL then the page should be
redirected to login page.
	ii) After session time out if user will click on any link/button then the
page should be
	    redirected to session expire page.

	For these requirements i have used filter in my code,

	public void doFilter(ServletRequest request, ServletResponse response,
	    FilterChain chain) throws IOException, ServletException {

		String page = "/sessionExpire.jsf";

		HttpServletRequest req = (HttpServletRequest) request;

		if (req.getSession().isNew()) {
		RequestDispatcher rd = request.getRequestDispatcher(page);
		rd.forward(request, response);
	    } else {
		chain.doFilter(request, response);
	    }
	}

	I am checking the condition req.getSession().isNew() because after session
time out if
user will click some where then one new session is get created.
But how can i implement my reqirement i) ?

     Any suggestion will be appreciated.
     Thanks...
regards
Arvind Pandey

Disclaimer: The information contained in this e-mail and attachments if any are privileged
and confidential and are intended for the individual(s) or entity(ies) named in this e-mail.
If the reader or recipient is not the intended recipient, or employee or agent responsible
for delivering to the intended recipient, you are hereby notified that dissemination, distribution
or copying of this communication or attachments thereof is strictly prohibited. IF YOU RECEIVE
this communication in error, please immediately notify the sender and return the original
message.

Mime
View raw message