0

We have a Spring REST environment which is producing json response. Below is the code which is used to send the json response

@GET
@Path("/userinfo.json/{userid}")
@Produces("application/json")
public List<UserinfoBean> getUserAllInformation(@PathParam("userid") String userid) 
{
    return openServicesAPI.getUserAllInformation(userid);
}

Can anyone let me know how I can set the request/response attribute and if at all possible create an HTTPsession here.

1
  • What attribute of response? Commented Feb 7, 2013 at 5:47

1 Answer 1

2

Use @Context this will give you the Contextual information

getUserAllInformation(@Context HttpServletRequest request,
@Context HttpServletResponse response,
@PathParam("userid") String userid){

//...

}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.