RE: Restlet JAX-RS question
Hi Fabio, This dependency is only for the FileUploadProvider class. The direction I'd like to follow in Restlet 2.1 is to leverage the ConverterProvider and Restlet's ConverterService instead of duplicating this logic in all those providers. This will make this Servlet dependency unnecessary. For your case, we should consider pluggable injectors, using the META-INF/services pattern. I've update the issue containing your patch. Best regards, Jerome Louvel -- Restlet ~ Founder and Technical Lead ~ http://www.restlet.org Noelios Technologies ~ http://www.noelios.com -Message d'origine- De : Fabio Mancinelli [mailto:fabio.mancine...@gmail.com] Envoyé : jeudi 25 mars 2010 13:39 À : Jerome Louvel Cc : discuss; Stephan Koops Objet : Re: Restlet JAX-RS question Hi again... by the way the JAX-RS module has already a dependency on the servlet API (http://restlet.tigris.org/source/browse/*checkout*/restlet/trunk/modules/or g.restlet.ext.jaxrs/pom.xml?revision=5522&content-type=text%2Fplain) -Fabio On Thu, Mar 25, 2010 at 12:35 PM, Jerome Louvel wrote: > Hi guys, > > Sorry for being late to the discussion. > > The dependency on the Servlet API is an issue indeed, but I think you should > be able to achieve what you want by injecting the Restlet request/response > and then from that retrieving the Servlet request/response. > > org.restlet.ext.servlet.internal.ServletCall class has this static method to > help: > getRequest(org.restlet.Request) : HttpServletRequest > > In order to make this more obvious, I've just added to SVN trunk a > ServletUtils class to the Servlet extension with two static methods to > easily retrieve the Servlet request/response. > > Best regards, > Jerome Louvel > -- > Restlet ~ Founder and Technical Lead ~ http://www.restlet.org > Noelios Technologies ~ http://www.noelios.com > > -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2593344
Re: Restlet JAX-RS question
On Thu, Mar 25, 2010 at 12:35 PM, Jerome Louvel wrote: > Hi guys, > > Sorry for being late to the discussion. > > The dependency on the Servlet API is an issue indeed, but I think you should > be able to achieve what you want by injecting the Restlet request/response > and then from that retrieving the Servlet request/response. > > org.restlet.ext.servlet.internal.ServletCall class has this static method to > help: > getRequest(org.restlet.Request) : HttpServletRequest > > In order to make this more obvious, I've just added to SVN trunk a > ServletUtils class to the Servlet extension with two static methods to > easily retrieve the Servlet request/response. > > Best regards, > Jerome Louvel > -- Hi, I don't know if you have seen it, but I contributed a patch... Actually I inject directly the HttpServletRequest using something that maybe is similar to what you describe there (hence, the ext.servlet dependency) By injecting the Restlet Request we would remove the dependency and we provide a way for retrieving the HttpServletRequest in the JAX-RS resources. It is indeed a good idea! And is almost implemented in the patch I sent (it's just a matter of removing some lines, providing that the rest is good :)) Thanks for the feedback! -Fabio P.S.: Link to the patch : http://restlet.tigris.org/issues/show_bug.cgi?id=722 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2464893
Re: Restlet JAX-RS question
Hi again... by the way the JAX-RS module has already a dependency on the servlet API (http://restlet.tigris.org/source/browse/*checkout*/restlet/trunk/modules/org.restlet.ext.jaxrs/pom.xml?revision=5522&content-type=text%2Fplain) -Fabio On Thu, Mar 25, 2010 at 12:35 PM, Jerome Louvel wrote: > Hi guys, > > Sorry for being late to the discussion. > > The dependency on the Servlet API is an issue indeed, but I think you should > be able to achieve what you want by injecting the Restlet request/response > and then from that retrieving the Servlet request/response. > > org.restlet.ext.servlet.internal.ServletCall class has this static method to > help: > getRequest(org.restlet.Request) : HttpServletRequest > > In order to make this more obvious, I've just added to SVN trunk a > ServletUtils class to the Servlet extension with two static methods to > easily retrieve the Servlet request/response. > > Best regards, > Jerome Louvel > -- > Restlet ~ Founder and Technical Lead ~ http://www.restlet.org > Noelios Technologies ~ http://www.noelios.com > > -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2464894
RE: Restlet JAX-RS question
Hi guys, Sorry for being late to the discussion. The dependency on the Servlet API is an issue indeed, but I think you should be able to achieve what you want by injecting the Restlet request/response and then from that retrieving the Servlet request/response. org.restlet.ext.servlet.internal.ServletCall class has this static method to help: getRequest(org.restlet.Request) : HttpServletRequest In order to make this more obvious, I've just added to SVN trunk a ServletUtils class to the Servlet extension with two static methods to easily retrieve the Servlet request/response. Best regards, Jerome Louvel -- Restlet ~ Founder and Technical Lead ~ http://www.restlet.org Noelios Technologies ~ http://www.noelios.com -Message d'origine- De : stephan.ko...@web.de [mailto:stephan.ko...@web.de] Envoyé : vendredi 26 février 2010 18:22 À : discuss@restlet.tigris.org Objet : Re: Restlet JAX-RS question Hi Fabio, hi Jerome, hi Thierry, cool Fabio, that you want allow the the Servlet artifacts in JAX-RS. Every help is welcome. I think it is important, that the JAX-RS extension has no dependency to the Servlet API, so we need to have another way. @ Jerome and Theirry: Do you think it useful to create an "extension extension", that has all that needs dependencies to the Servlet API? Than I have an idea how to implement it. Or do you have another ideas? Are there other ideas what also could be included, that means could be annotated with @Context? best regards Stephan Fabio Mancinelli schrieb: > Hi Stephan, > > I am writing to you to ask a little advice. > I was thinking about writing a patch to the JAX-RS extension in order > to allow the injection of the HttpServletRequest and > HttpServletRespone objects using the @Context annotation. > > Could you point me to the code where injection is done and if I should > be aware of some architectural details you used for implementing the > injection mechanism? > > Thank you. > > Regards, > Fabio > -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24526 33 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2464857
Re: Restlet JAX-RS question
Hi Fabio, hi Jerome, hi Thierry, cool Fabio, that you want allow the the Servlet artifacts in JAX-RS. Every help is welcome. I think it is important, that the JAX-RS extension has no dependency to the Servlet API, so we need to have another way. @ Jerome and Theirry: Do you think it useful to create an "extension extension", that has all that needs dependencies to the Servlet API? Than I have an idea how to implement it. Or do you have another ideas? Are there other ideas what also could be included, that means could be annotated with @Context? best regards Stephan Fabio Mancinelli schrieb: > Hi Stephan, > > I am writing to you to ask a little advice. > I was thinking about writing a patch to the JAX-RS extension in order > to allow the injection of the HttpServletRequest and > HttpServletRespone objects using the @Context annotation. > > Could you point me to the code where injection is done and if I should > be aware of some architectural details you used for implementing the > injection mechanism? > > Thank you. > > Regards, > Fabio > -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2452633