This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60050
    
  65

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
 
Similar Threads
Unable to get the filter to work
Question about setting up Cactus for JSP Testing
Servlet not showing up in Browser
To the man who shares my namesake...Aaron Mulder
Servlet.JSP,JSTL Specs