Announcement Announcement Module
Collapse
No announcement yet.
Static access to ServletRequest and ServletResponse Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Static access to ServletRequest and ServletResponse

    Hi

    does Spring 2.5 have any Support/Utility/Holder/Helper class which provides static access to the current HttpServletRequest and HttpServletResponse from somewhere in my web application?

    I thought that there were some spring magic using ThreadLocal...

    Many thanks in advance

  • #2
    If request is going through DispatcherServlet then you can get httpServletRequest as
    Code:
     httpServletRequest =((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest();

    Comment

    Working...
    X