Update of /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/authenticator
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv8884/src/share/org/securityfilter/authenticator
Modified Files:
FormAuthenticator.java
Log Message:
Added configuration parameter to set the encoding used for forwarded parameters.
Index: FormAuthenticator.java
===================================================================
RCS file: /cvsroot/securityfilter/securityfilter/src/share/org/securityfilter/authenticator/FormAuthenticator.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** FormAuthenticator.java 2 Nov 2007 16:31:24 -0000 1.12
--- FormAuthenticator.java 18 Apr 2008 13:08:03 -0000 1.13
***************
*** 128,131 ****
--- 128,139 ----
public static final String FORWARD_PARAMETERS_PARAMETER_KEY = "forwardParametersParameter";
+
+ /**
+ * The key that will be used to look the filter init parameter
+ * that specifies the character encoding to be used for parameters
+ * forwarded from the login form.
+ */
+ public static final String FORWARD_PARAMETERS_ENCODING_KEY = "forwardParametersEncoding";
+
/**
* The default value for {@link #forwardParameterName}.
***************
*** 142,145 ****
--- 150,158 ----
/**
+ * The default encoding to be used for forwarded parameters.
+ */
+ public static final String DEFAULT_FORWARD_PARAMETERS_ENCODING = "UTF-8";
+
+ /**
* The name of the request parameter that will be recognized as a
* post-login forward request.
***************
*** 173,176 ****
--- 186,195 ----
protected String forwardParametersParameterName;
+ /**
+ * The character encoding that will be used to encode URL parameters
+ * forwarded through the login page.
+ */
+ protected String forwardParametersEncoding;
+
/**
* Initilize this Authenticator.
***************
*** 204,207 ****
--- 223,231 ----
forwardParametersParameterName = DEFAULT_FORWARD_PARAMETERS_PARAMETER_NAME;
+ //
+ forwardParametersEncoding = filterConfig.getInitParameter(FORWARD_PARAMETERS_ENCODING_KEY);
+ if(null == forwardParametersEncoding)
+ forwardParametersEncoding = DEFAULT_FORWARD_PARAMETERS_ENCODING;
+
// default page
defaultPage = securityConfig.getDefaultPage();
***************
*** 548,554 ****
queryString
! .append(URLEncoder.encode(name, "UTF-8"))
.append('=')
! .append(URLEncoder.encode(values[i], "UTF-8"));
}
}
--- 572,578 ----
queryString
! .append(URLEncoder.encode(name, forwardParametersEncoding))
.append('=')
! .append(URLEncoder.encode(values[i], forwardParametersEncoding));
}
}
|