Add exception with more helpful error message.

[#54676948] Filter registered twice
This commit is contained in:
Dave Syer 2013-08-06 13:13:59 +01:00
parent a602ce3f10
commit e967c2d551
86 changed files with 3 additions and 1 deletions

View File

@ -104,10 +104,12 @@ public abstract class RegistrationBean implements ServletContextInitializer {
* Configure registration base settings.
*/
protected void configure(Registration.Dynamic registration) {
Assert.state(registration != null,
"Registration is null. Was something already registered for name=["
+ this.name + "]?");
registration.setAsyncSupported(this.asyncSupported);
if (this.initParameters.size() > 0) {
registration.setInitParameters(this.initParameters);
}
}
}