java 如何使用resteasy开发身份验证?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1807781/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to develop authentication with resteasy?
提问by newbie
I'm making small web service(1) and I decided to use resteasy to make it. But I need to know what would be best practise to develop authentication with resteasy. And what kind of responses webservice should send? Are responses usually in XML or what format, and what format of XML response should be?
我正在制作小型网络服务(1),我决定使用 resteasy 来制作它。但是我需要知道使用resteasy开发身份验证的最佳实践是什么。网络服务应该发送什么样的响应?响应通常是 XML 还是什么格式,XML 响应应该是什么格式?
Btw. I use jboss 4 and Java 5.
顺便提一句。我使用 jboss 4 和 Java 5。
http://www.assertionerror.com/2009/02/26/restful-web-services-with-resteasy/
http://www.assertionerror.com/2009/02/26/restful-web-services-with-resteasy/
(1) What technology I should use to develop small Java webservice?
采纳答案by miku
Authentication: http://www.jboss.org/file-access/default/members/resteasy/freezone/docs/1.2.GA/userguide/html/Authentication.html
What kind of responses? What's suitable for your application; XML, atom, plaintext, ...
- Response need not to be XML, see
@Produces("your-content-type")annotation
认证:http: //www.jboss.org/file-access/default/members/resteasy/freezone/docs/1.2.GA/userguide/html/Authentication.html
什么样的回应?什么适合您的应用;XML、原子、明文、...
- 响应不必是 XML,见
@Produces("your-content-type")注解
回答by Tommaso
For the authentication you can use the Interceptor (classes that are invoked before the RESTEasy annotated class), see
对于身份验证,您可以使用拦截器(在 RESTEasy 注释类之前调用的类),请参阅
I'm developing a big application, and I'm using Interceptors for the authentication
我正在开发一个大型应用程序,我正在使用拦截器进行身份验证

