How to develop authentication with resteasy?

試著忘記壹切 提交于 2019-12-06 12:14:32

问题


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?

Btw. I use jboss 4 and Java 5.

http://www.assertionerror.com/2009/02/26/restful-web-services-with-resteasy/

(1) What technology I should use to develop small Java webservice?


回答1:


  • 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



回答2:


For the authentication you can use the Interceptor (classes that are invoked before the RESTEasy annotated class), see

  • RESTEasy Interceptors
  • Authentication in RESTEasy

  • client ip in interceptor

I'm developing a big application, and I'm using Interceptors for the authentication



来源:https://stackoverflow.com/questions/1807781/how-to-develop-authentication-with-resteasy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!