custom injector not working

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

custom injector not working

Trenton D. Adams
Good day,


It seems like Jersey doesn have an HttpServletRequest injector, so my injector doesn't work.  Is that right?  And if so, do the docs maybe need to be updated?

Either way, how do I go about following the guide, and getting a custom injector working?

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom injector not working

Mark Thornton
What container are you using? As far as I can recall, HttpServletRequest is injected when running in a servlet container. It does not work in any of the Http server containers (Grizzly, Jetty, JDK). The main thing I want from a servlet request is the remote IP address, the absence of which is awkward in the non servlet containers.

Regards,
Mark Thornton

On 19 February 2016 at 22:36, Trenton D. Adams <[hidden email]> wrote:
Good day,


It seems like Jersey doesn have an HttpServletRequest injector, so my injector doesn't work.  Is that right?  And if so, do the docs maybe need to be updated?

Either way, how do I go about following the guide, and getting a custom injector working?

Thanks.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom injector not working

Trenton D. Adams
It seems like some of the jersey template related stuff is too magical.  It would be far better if path resolution was required to be explicitly defined in the code, such as @Template (autoResolve = true) or something like that.  Even though I read the docs, it wasn't obvious that it was resolving to package/Class/index.jsp by default, for example.  So, even running it in tomcat, and it still didn't work.

I'm going to see if I can define exactly why I couldn't figure it out initially, so that perhaps I can suggest an update to the docs.  But yes, another one of the aspects of it not working, leading me in wild goose chase, was that the grizzly container does not work with templates.

Was it not working with the light weight containers documented anywhere in the docs?  It certainly doesn't appear that it was.

On Sat, Feb 20, 2016 at 2:28 AM, Mark Thornton <[hidden email]> wrote:
What container are you using? As far as I can recall, HttpServletRequest is injected when running in a servlet container. It does not work in any of the Http server containers (Grizzly, Jetty, JDK). The main thing I want from a servlet request is the remote IP address, the absence of which is awkward in the non servlet containers.

Regards,
Mark Thornton

On 19 February 2016 at 22:36, Trenton D. Adams <[hidden email]> wrote:
Good day,


It seems like Jersey doesn have an HttpServletRequest injector, so my injector doesn't work.  Is that right?  And if so, do the docs maybe need to be updated?

Either way, how do I go about following the guide, and getting a custom injector working?

Thanks.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: custom injector not working

Trenton D. Adams
Oops, sorry, wrong thread.  It's way too late for me to be responding, lol.


On Sat, Feb 20, 2016 at 2:50 AM, Trenton D. Adams <[hidden email]> wrote:
It seems like some of the jersey template related stuff is too magical.  It would be far better if path resolution was required to be explicitly defined in the code, such as @Template (autoResolve = true) or something like that.  Even though I read the docs, it wasn't obvious that it was resolving to package/Class/index.jsp by default, for example.  So, even running it in tomcat, and it still didn't work.

I'm going to see if I can define exactly why I couldn't figure it out initially, so that perhaps I can suggest an update to the docs.  But yes, another one of the aspects of it not working, leading me in wild goose chase, was that the grizzly container does not work with templates.

Was it not working with the light weight containers documented anywhere in the docs?  It certainly doesn't appear that it was.

On Sat, Feb 20, 2016 at 2:28 AM, Mark Thornton <[hidden email]> wrote:
What container are you using? As far as I can recall, HttpServletRequest is injected when running in a servlet container. It does not work in any of the Http server containers (Grizzly, Jetty, JDK). The main thing I want from a servlet request is the remote IP address, the absence of which is awkward in the non servlet containers.

Regards,
Mark Thornton

On 19 February 2016 at 22:36, Trenton D. Adams <[hidden email]> wrote:
Good day,


It seems like Jersey doesn have an HttpServletRequest injector, so my injector doesn't work.  Is that right?  And if so, do the docs maybe need to be updated?

Either way, how do I go about following the guide, and getting a custom injector working?

Thanks.



Loading...