aspose file tools*
The moose likes Spring and the fly likes Getting HttpServletRequest from RequestContextHolder  in Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Getting HttpServletRequest from RequestContextHolder  in Spring" Watch "Getting HttpServletRequest from RequestContextHolder  in Spring" New topic
Author

Getting HttpServletRequest from RequestContextHolder in Spring

Prams Kulkarni
Greenhorn

Joined: Dec 15, 2007
Posts: 4
Hi, I'm trying to get the HttpServletRequest from RequestContextHolder using Spring MVC.



But while running test cases during the build of the application I'm getting following ClassCastException

java.lang.ClassCastException: java.lang.Object cannot be cast to javax.servlet.http.HttpServletRequest

Is there a way to get the HttpServletRequest from the RequestContextHolder in spring.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Getting HttpServletRequest from RequestContextHolder in Spring