I am using spring framework in my project,
Here is part of my web.xml:
SpringMvcServlet
First of all: I think you abuse the ResourceHttpRequestHandler
when you try to use it for POST requests. -- And I am not sure that every thing works correct if you made this handler to handle POST requests.
<mvc:resources />
configure an instance of class org.springframework.web.servlet.resource.ResourceHttpRequestHandler
. This has the super class WebContentGenerator
and this super class has a property Set<String> supportedMethods
.
So all what you need to do is:
<property name="supportedMethods">
<list>
<value>GET</value>
<value>HEAD</value>
<value>POST</value>
</list>
</property>
Unfortunately this requires that you configure the ResourceHttpRequestHandler
by hand instead of using <mvc:resources />
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/system/**" value="myResourceHandler" />
</map>
</property>
<property name="order" value="100000" />
</bean>
<bean id="myResourceHandler" name="myResourceHandler"
class="org.springframework.web.servlet.resource.ResourceHttpRequestHandler">
<property name="locations" value="/WEB-INF/pages/system/" />
<property name="supportedMethods">
<list>
<value>GET</value>
<value>HEAD</value>
<value>POST</value>
</list>
</property>
<!-- cacheSeconds: maybe you should set it to zero because of the posts-->
</bean>
I have not proved this configuration, I have just written it down from what the ResourceBeanDefintionParser
does.