Spring MVC - Response -
how can access response object bean? request object use following.
servletrequestattributes attr = (servletrequestattributes) requestcontextholder.currentrequestattributes(); is there similar above response object?
if in web application context (which looks are) can auto wire in httpservletrequest or httpservletresponse.
the request/response current request scope injected.
@component public class somecomponentinawebapplicationcontext { @autowired private httpservletrequest request; @autowired private httpservletresponse response; ... }
Comments
Post a Comment