aspose file tools*
The moose likes JSP and the fly likes servlet path in a filter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "servlet path in a filter" Watch "servlet path in a filter" New topic
Author

servlet path in a filter

Jerret Halter
Ranch Hand

Joined: Feb 03, 2006
Posts: 62
I am having troubles retrieving the servlet path in a filter I wrote. Within the doFilter() method I cast the ServletRequest to a HttpServletRequest then call getServletRequest() on it and store what is returned into a String, but it is only returning the name of the servlet. For example.

http://localhost/contextRoot/foo/bar/servlet.jsp will only return

servlet.jsp instead of

/foo/bar/servlet.jsp

My configurations in my web.xml are correct.

Any ideas?


Jerret Halter<br /> <br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.<hr></blockquote>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Perhaps if you were to explore the rest of the request API...


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet path in a filter