Overwrite HTTP method with JAX-RS

后端 未结 3 1702
囚心锁ツ
囚心锁ツ 2021-01-24 02:03

Today\'s browsers (or HTML < 5) only support HTTP GET and POST, but to communicate RESTful one need PUT and DELETE too. If the workaround should not be to use Ajax, something

3条回答
  •  借酒劲吻你
    2021-01-24 02:23

    Not strictly a JAX-RS solution but spring 3.0 comes with a HiddenHttpMethodFilter that implements exactly the trick that rails does, defaults to the same _method parameter.

    Note that you don't need to be using all of spring to use this filter, you can just configure it in your web.xml and ignore the rest of spring.

提交回复
热议问题