aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/module-stork/src/main/java/at
diff options
context:
space:
mode:
authorThomas Knall <t.knall@datentechnik-innovation.com>2015-02-04 13:54:32 +0100
committerThomas Knall <t.knall@datentechnik-innovation.com>2015-02-04 13:54:32 +0100
commita9dc7e094a8732f9826ab77648758dd39adc7324 (patch)
treef88ddc37edf6f0e6328ab6322e63e563053874a0 /id/server/modules/module-stork/src/main/java/at
parent215b326e807659b30c520478e8123a888df6d204 (diff)
downloadmoa-id-spss-a9dc7e094a8732f9826ab77648758dd39adc7324.tar.gz
moa-id-spss-a9dc7e094a8732f9826ab77648758dd39adc7324.tar.bz2
moa-id-spss-a9dc7e094a8732f9826ab77648758dd39adc7324.zip
Add logging for automatic servlet registration.
Diffstat (limited to 'id/server/modules/module-stork/src/main/java/at')
-rw-r--r--id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java
index 7478a57c3..c54c9a26d 100644
--- a/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java
+++ b/id/server/modules/module-stork/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java
@@ -4,6 +4,8 @@ import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.web.WebApplicationInitializer;
import at.gv.egovernment.moa.id.auth.servlet.ProcessEngineSignalServlet;
@@ -23,15 +25,24 @@ import at.gv.egovernment.moa.id.auth.servlet.ProcessEngineSignalServlet;
* @see ProcessEngineSignalServlet
*/
public class STORKWebApplicationInitializer implements WebApplicationInitializer {
+
+ private Logger log = LoggerFactory.getLogger(getClass());
+
+ private static final String SIGNAL_SERVLET_NAME = "ProcessEngineSignal";
+
+ private void addMapping(ServletRegistration servletRegistration, String mapping) {
+ log.debug("Adding mapping '{}' to servlet '{}' ({}).", mapping, SIGNAL_SERVLET_NAME, servletRegistration.getClassName());
+ servletRegistration.addMapping(mapping);
+ }
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
- ServletRegistration servletRegistration = servletContext.getServletRegistration("ProcessEngineSignal");
+ ServletRegistration servletRegistration = servletContext.getServletRegistration(SIGNAL_SERVLET_NAME);
if (servletRegistration == null) {
- throw new IllegalStateException("Servlet 'ProcessEngineSignal' expected to be registered.");
+ throw new IllegalStateException("Servlet '" + SIGNAL_SERVLET_NAME + "' expected to be registered (e.g. by web.xml).");
}
- servletRegistration.addMapping("/PEPSConnectorWithLocalSigning");
- servletRegistration.addMapping("/PEPSConnector");
+ addMapping(servletRegistration, "/PEPSConnectorWithLocalSigning");
+ addMapping(servletRegistration, "/PEPSConnector");
}
}