开发者

How to check for an OPTIONS method call in a java servlet filter?

开发者 https://www.devze.com 2023-03-27 04:49 出处:网络
I have a servlet filter, in which if the call is OPTIONS method call, then a specific set of task needs to be done.

I have a servlet filter, in which if the call is OPTIONS method call, then a specific set of task needs to be done.

Is there a way I can check my custom filter , which as of now , extends javax.servlet.filter, if an incoming http request is a request开发者_运维百科 for an OPTIONS call??

Thanks

PS:Im using jetty as my app server.


getMethod in HttpServletRequest is maybe what you need: http://download.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getMethod()

It should return OPTIONS in case of an OPTIONS request.


You must implement doOptions() method.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号