Hi Colleagues,

I wanted confirm on one particular flow. If there is a spring controller for REST and we auto-wire HttpServletResponse along the flow in any of the underlying classes. I mean not in @Controller, but any other @Service class. Still would it be RequestScoped?

Please help.

Comment From: bclozel

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

I'm not sure I understand your question, but indeed injecting a scoped-component (you wouldn't inject the request itself).

I think that in general it's a good idea to use @Controller and other MVC infrastructure classes to act as an interface between the web and the application; extracting information from the request thanks to controller flexible signatures, or providing that information so that a shared component can set it as a header, is a better idea.

In your case, asking a question on StackOverflow and describing 1) what you're trying to achieve (the use case) 2) what you've tried so far and 3) why it's not working out for you so far - will help you more than questions here.

Thanks!