|
I solved the problem using sendRedirect().
However forward() was apparently used successfully in http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html
so I am wondering whether this problem is specific to myfaces. Regards, Yee From: Yee CN [mailto: Hi, I am trying to write a very simple security filter to
redirect the user to the login page if he/she is not login, something like the
following:
public void doFilter(ServletRequest req, ServletResponse res, FilterChain
chain)
throws IOException, ServletException {
if (!authenticated((HttpServletRequest)req)) {
((HttpServletRequest)req).getRequestDispatcher(“/login.jsf”).forward(req,
res);
} else {
chain.doFilter(req, res);
}
} But I seems to be having problems with
getRequestDispatcher(“/login.jsf”).forward(). The login.jsf got forwarded to OK, however the JSF engine
seems to get very confused afterwards. The URL shown in the browser window is
of the following form: http://localhost:8080/myapp/login.jsf;jsessionid=46D86B99BE29C1F112F1C8BD3CBA6D6D and nothing works till I logon via the login page directly. Anyway around this? Many thanks in advance. Yee |
- RE: Cannot do getRequestDispatcher("/login.... Yee CN
- Re: Cannot do getRequestDispatcher("/l... Michael Ageeb
- RE: Cannot do getRequestDispatcher("/l... CONNER, BRENDAN \(SBCSI\)

