Java 使用HttpMethodFilter放置不使用urlRewrite
我在web.xml中放置了httpMethodFilter,用于将post方法转换为put和delete,但不使用URLRewite 调度员 org.springframework.web.servlet.DispatcherServlet 2. 调度员 /应用程序/*Java 使用HttpMethodFilter放置不使用urlRewrite,java,spring-mvc,Java,Spring Mvc,我在web.xml中放置了httpMethodFilter,用于将post方法转换为put和delete,但不使用URLRewite 调度员 org.springframework.web.servlet.DispatcherServlet 2. 调度员 /应用程序/* 请确定问题所在您应该添加url模式 <filter-mapping> <filter-name>httpMethodFilter</filter-name>
请确定问题所在您应该添加url模式
<filter-mapping>
<filter-name>httpMethodFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
httpMethodFilter
/*
<urlrewrite default-match-type="wildcard">
<rule>
<from>/scripts/**</from>
<to last="true">/scripts/$1</to>
</rule>
<rule>
<from>/css/**</from>
<to last="true">/css/$1</to>
</rule>
<rule>
<from>/</from>
<to last="true">/app/index</to>
</rule>
<rule>
<from>/app/**</from>
<to last="true">/app/$1</to>
</rule>
<rule>
<from>/**</from>
<to>/app/$1</to>
</rule>
<outbound-rule>
<from>/app/**</from>
<to>/$1</to>
</outbound-rule> </urlrewrite>
@RequestMapping(method = RequestMethod.PUT, value = "/{articleId}/edit")
public String update(Article article,ModelMap model) {
//code here
}
<filter-mapping>
<filter-name>httpMethodFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>