Broekelmann, Mathias wrote:

Try to use a servlet filter. Simply place it before the jsf filter and make the check in the filter. Use:
request.getRequestDispatcher("/faces/jsp/login.jsp").forward(request, response)

to forward to the login page. You also don“t have to include the jsp code on 
every page by using a filter.

Thanks for the tip.
The filter now looks like:

public void doFilter(ServletRequest request, ServletResponse response,
      FilterChain chain) throws IOException, ServletException
{
  if (((HttpServletRequest)request).getSession(false) == null)
  {
    request.getRequestDispatcher("/faces/jsp/login.jsp").
      forward(request,response);
  }

  chain.doFilter(request, response);
}

and works fine.

Michael
--

Reply via email to