How to stop JSP access
[email protected] Mon, 30 Jun 2003 11:09:19 +0200
| Newsgroups | gmane.comp.java.mvc.devel |
|---|---|
| Message-ID | <OF4AB3F745.F267BB98-ONC1256D55.003183C1-C1256D55.003274D0@diamond.philips.com> |
Hi All
What i want to do is make sure that you are logged on before you can
access any pages
I have extended the RequestProcessor this works, but the problem is that people can still point to the .JSP
pages
Any tips?
Thanks
Jon
protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse
response) {
boolean continueProcessing = true;
HttpSession session = request.getSession();
Object user = session.getAttribute(Constants.USER_KEY);
if (user == null) {
ForwardConfig config =
appConfig.findForwardConfig("login");
try {
response.sendRedirect(config.getPath());
}
catch (Exception ex) {
log.error("Problem sending redirect from processPreprocess()");
}
}
return continueProcessing;
}