Common exercise of HttpServletRequest is when getting the asking variables or for HttpServletResponse when downloading a file.
How to inject:
REST:
In REST it's every bit exactly every bit injecting the HttpServlet object. For example:
@Context mortal HttpServletResponse httpServletResponse; @Context mortal HttpServletRequest httpServletRequest;
As for SOAP, it's nearly the same:
@Resource protected WebServiceContext webServiceContext; MessageContext mc = webServiceContext.getMessageContext(); HttpServletResponse reply = (HttpServletResponse) mc.get(MessageContext.SERVLET_RESPONSE);
0 komentar:
Please comment if there are any that need to be asked.