Commits

Stephan Oudmaijer  committed 90df679

Added hiddenHttpMethodFilter.

  • Participants
  • Parent commits 8f4073f

Comments (0)

Files changed (1)

File src/main/java/com/oudmaijer/administratie/config/SpringWebInitializer.java

 
 import org.springframework.web.WebApplicationInitializer;
 import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
+import org.springframework.web.filter.HiddenHttpMethodFilter;
 import org.springframework.web.filter.ShallowEtagHeaderFilter;
 import org.springframework.web.servlet.DispatcherServlet;
 
         AnnotationConfigWebApplicationContext mvcContext = new AnnotationConfigWebApplicationContext();
         mvcContext.register(SpringConfig.class);
 
-        FilterRegistration fr = servletContext.addFilter("etagFilter", new ShallowEtagHeaderFilter());
-        fr.addMappingForServletNames(EnumSet.of(DispatcherType.REQUEST), true, "dispatcher");
+        FilterRegistration hiddenHttpMethodFilter = servletContext.addFilter("hiddenHttpMethodFilter", new HiddenHttpMethodFilter());
+        hiddenHttpMethodFilter.addMappingForServletNames(EnumSet.of(DispatcherType.REQUEST), true, "dispatcher");
+
+        FilterRegistration etagFilter = servletContext.addFilter("etagFilter", new ShallowEtagHeaderFilter());
+        etagFilter.addMappingForServletNames(EnumSet.of(DispatcherType.REQUEST), true, "dispatcher");
 
         ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", new DispatcherServlet(mvcContext));
         dispatcher.setLoadOnStartup(1);