wood burning stoves 2.0*
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
JavaRanch » Java Forums » Java » JSP
Bookmark "servlet path in a filter" Watch "servlet path in a filter" New topic

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


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

Joined: Jan 10, 2002
Posts: 60774

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

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
It is sorta covered in the JavaRanch Style Guide.
subject: servlet path in a filter
Similar Threads
Question about setting up Cactus for JSP Testing
Servlet.JSP,JSTL Specs
Servlet not showing up in Browser
To the man who shares my namesake...Aaron Mulder
Unable to get the filter to work