Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the HttpServletRequest inputstream details in a Filter?  RSS feed

 
Rithanya Laxmi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I am using Filter to intercept each request, where in filter I can get only ServletRequest inputstream, which is returning empty input stream, to get the input stream in seems that I need to get the HttpServletRequest? When I use HttpServletWrapper or cast the ServletRequest to HttpServletRequest I was getting an error in weblogic(in which the app. is deployed) saying Filter wont support HttpServletRequest? How to get rid of this problem & how to get the HttpServletRequest input stream in filter? Please clarify.

Thanks.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be more explicit about the problems you encountered when trying to cast the request to HttpServletRequest.
 
Frederik Nielsen
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;

 
Luan Cestari
Ranch Hand
Posts: 172
C++ Redhat Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of weblogic are you using?

Maybe you reference a different version of the Servlet API in your project and your server is old and doesn't have that class. There is also the possibility that you put the JAR with the implementation of the API on your project, could you paste here a tree view of the files of your project and your pom.xml (if you use maven).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!