Jersey REST:如何编写泽西方法,包括验证HTTP授权 [英] Jersey REST:How to write a jersey method including verifying HTTP Authorization
本文介绍了Jersey REST:如何编写泽西方法,包括验证HTTP授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一个Restful webservice方法,它首先需要授权...
,例如findItems方法......在Http授权中需要用户名和密码
示例代码:
I am writing a Restful webservice method,which require authorization first... such as a findItems method..which need username and password in Http Authorization the sample code:
@GET
@Produce(MediaType.APPLICATION_JSON)
public String findItems(){
...
}
如何在方法执行前验证http授权...
how to verify the http authorization before the method excutes...
推荐答案
您可以使用过滤器
以便检查授权
you can use Filters
so you can check the authorization
这篇关于Jersey REST:如何编写泽西方法,包括验证HTTP授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文