/*
- * $Header: /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/filter/SecurityFilter.java,v 1.10 2002/12/17 15:10:00 maxcooper Exp $
- * $Revision: 1.10 $
- * $Date: 2002/12/17 15:10:00 $
+ * $Header: /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/filter/SecurityFilter.java,v 1.11 2003/01/05 09:25:00 maxcooper Exp $
+ * $Revision: 1.11 $
+ * $Date: 2003/01/05 09:25:00 $
*
* ====================================================================
* The SecurityFilter Software License, Version 1.1
*
* @author Max Cooper (max@maxcooper.com)
* @author Torgeir Veimo (torgeir@pobox.com)
- * @version $Revision: 1.10 $ $Date: 2002/12/17 15:10:00 $
+ * @version $Revision: 1.11 $ $Date: 2003/01/05 09:25:00 $
*/
public class SecurityFilter implements Filter {
public static final String SAVED_REQUEST_URL = SecurityFilter.class.getName() + ".SAVED_REQUEST_URL";
protected String errorPage;
protected String defaultPage;
protected URLPatternFactory patternFactory;
- protected URLPattern loginSubmitPattern;
protected List patternList;
protected static final String FORM_USERNAME = "j_username";
protected static final String FORM_PASSWORD = "j_password";
- protected static final String FORM_SUBMIT_PATTERN = "*/j_security_check";
+ protected static final String FORM_SUBMIT_URL = "/j_security_check";
/**
* Perform filtering operation, and optionally pass the request down the chain.
URLPattern match = null;
try {
// check if this is a login form submittal
- if (patternMatcher.match(requestURL, loginSubmitPattern)) {
+ if (requestURL.endsWith(FORM_SUBMIT_URL)) {
processLogin(wrappedRequest, hRes);
return;
}
try {
patternFactory = new URLPatternFactory();
- // login submit RE
- try {
- loginSubmitPattern = patternFactory.createURLPattern(FORM_SUBMIT_PATTERN, null, null, 0);
- } catch (Exception e) {
- throw new ServletException("Error creating login submit pattern", e);
- }
-
// parse config file
String configFile = config.getInitParameter(CONFIG_FILE_KEY);
if (configFile == null) {