Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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


Win a copy of The Software Craftsman this week in the Agile forum!
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.
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Getting HttpServletRequest from RequestContextHolder in Spring