/** * Register a {@link MessageDispatcherServlet} against the given servlet context. * <p>This method will create a {@code MessageDispatcherServlet} with the name * returned by {@link #getServletName()}, initializing it with the application context * returned from {@link #createServletApplicationContext()}, and mapping it to the * patterns returned from {@link #getServletMappings()}. * <p>Further customization can be achieved by overriding {@link * #customizeRegistration(ServletRegistration.Dynamic)}. * @param servletContext the context to register the servlet against */ protected void registerMessageDispatcherServlet(ServletContext servletContext) { String servletName = this.getServletName(); Assert.hasLength(servletName, "getServletName() may not return empty or null"); WebApplicationContext servletAppContext = this.createServletApplicationContext(); Assert.notNull(servletAppContext, "createServletApplicationContext() did not return an application " + "context for servlet [" + servletName + "]"); MessageDispatcherServlet dispatcherServlet = new MessageDispatcherServlet(servletAppContext); dispatcherServlet.setTransformWsdlLocations(isTransformWsdlLocations()); dispatcherServlet.setTransformSchemaLocations(isTransformSchemaLocations()); ServletRegistration.Dynamic registration = servletContext.addServlet(servletName, dispatcherServlet); Assert.notNull(registration, "Failed to register servlet with name '" + servletName + "'." + "Check if there is another servlet registered under the same name."); registration.setLoadOnStartup(1); registration.addMapping(getServletMappings()); this.customizeRegistration(registration); }
/** * Register a {@link MessageDispatcherServlet} against the given servlet context. * <p>This method will create a {@code MessageDispatcherServlet} with the name * returned by {@link #getServletName()}, initializing it with the application context * returned from {@link #createServletApplicationContext()}, and mapping it to the * patterns returned from {@link #getServletMappings()}. * <p>Further customization can be achieved by overriding {@link * #customizeRegistration(ServletRegistration.Dynamic)}. * @param servletContext the context to register the servlet against */ protected void registerMessageDispatcherServlet(ServletContext servletContext) { String servletName = this.getServletName(); Assert.hasLength(servletName, "getServletName() may not return empty or null"); WebApplicationContext servletAppContext = this.createServletApplicationContext(); Assert.notNull(servletAppContext, "createServletApplicationContext() did not return an application " + "context for servlet [" + servletName + "]"); MessageDispatcherServlet dispatcherServlet = new MessageDispatcherServlet(servletAppContext); dispatcherServlet.setTransformWsdlLocations(isTransformWsdlLocations()); dispatcherServlet.setTransformSchemaLocations(isTransformSchemaLocations()); ServletRegistration.Dynamic registration = servletContext.addServlet(servletName, dispatcherServlet); Assert.notNull(registration, "Failed to register servlet with name '" + servletName + "'." + "Check if there is another servlet registered under the same name."); registration.setLoadOnStartup(1); registration.addMapping(getServletMappings()); this.customizeRegistration(registration); }
/** * Register a {@link MessageDispatcherServlet} against the given servlet context. * <p>This method will create a {@code MessageDispatcherServlet} with the name * returned by {@link #getServletName()}, initializing it with the application context * returned from {@link #createServletApplicationContext()}, and mapping it to the * patterns returned from {@link #getServletMappings()}. * <p>Further customization can be achieved by overriding {@link * #customizeRegistration(ServletRegistration.Dynamic)}. * @param servletContext the context to register the servlet against */ protected void registerMessageDispatcherServlet(ServletContext servletContext) { String servletName = this.getServletName(); Assert.hasLength(servletName, "getServletName() may not return empty or null"); WebApplicationContext servletAppContext = this.createServletApplicationContext(); Assert.notNull(servletAppContext, "createServletApplicationContext() did not return an application " + "context for servlet [" + servletName + "]"); MessageDispatcherServlet dispatcherServlet = new MessageDispatcherServlet(servletAppContext); dispatcherServlet.setTransformWsdlLocations(isTransformWsdlLocations()); dispatcherServlet.setTransformSchemaLocations(isTransformSchemaLocations()); ServletRegistration.Dynamic registration = servletContext.addServlet(servletName, dispatcherServlet); Assert.notNull(registration, "Failed to register servlet with name '" + servletName + "'." + "Check if there is another servlet registered under the same name."); registration.setLoadOnStartup(1); registration.addMapping(getServletMappings()); this.customizeRegistration(registration); }