I need to get and set some values in cookie inside the slingModel. I am currently adapting this to SlingHttpServletRequest. Is there any way to inject SlingHttpServletResponse inside the current slingModel.
See Praveen code in the thread that Kautuk pointed you to.
In that code snippet they are using only SlingHttpServletRequest object and is adapted to the SlingHttpServletRequest class.
In my case I need to use both SlingHttpServletRequest and SlingHttpResponse object.
For getting cookie value I'll use the below code
For setting cookie I need to use the below code
My question is how can I get both the objects in the same slingModel