Menu

#29 Enable/Disable continueURL feautre

open
nobody
5
2005-03-18
2005-03-18
No

Hi Max,

I've been using your securityFilter for the last couple
months and i evaluated many other open source projects
related to security and I decided to chose this one
because of its simplicity and ease of use.

Anway there is one slight annoyance when the users
session times out, the security filter redirects them
to the login screen and when they login again the
security filter redirects them to the saved URL or the
screen that they were on when the session timeout.

This can cause some problems as the page they are
redirected may require session data that can only be
populated by going through previous pages (workflow).
ie to get to the current page they may have to go
through several pages. It would be good if this feature
can be configurable in the sense that it can be disable
or enabled depending on whether you need this. For some
of my apps when their session timesout and they login
again going to the default page is fine.

I have included the code that might do this. I am happy
to dicuss this with you. I could modify the src code
and rebuild the jar but the company i work for hates us
modifying open source code and we are only allowed to
use the standard jars releases.

Regards
Mark

public class FormAuthenticator {

public static final String USE_CONTINUE_URL =
"useContinueURL";

protected Boolean useContinueURL;

public void init(FilterConfig filterConfig,
SecurityConfig securityConfig) throws Exception
{

String paramVal =
filterConfig.getInitParameter(USE_CONTINUE_URL);

if(paramVal!=null){
useContinueURL= new Boolean(paramVal);
}else{
useContinueURL= new Boolean(true);
}

}
private String getContinueToURL(HttpServletRequest
request) {

String savedURL = null;
if(useContinueURL.booleanValue()){
savedURL = SecurityFilter.getContinueToURL(request);
}
if(savedURL==null){
savedURL = request.getContextPath() +
defaultPage;
}
return savedURL;
}

Discussion


Log in to post a comment.

Monday.com Logo