Are you doing a "forward" or a "dispatch".   One of them handles mappings
differently because you are inside the application already and won't use the
filters a second time.   That is why the latest version of the servlet spec
allows you to specify which one in your web.xml mappings.

I'm heading outside so this quick question might get you pointed in the
right direction but you won't get an answer from me for another 8+ hours.
The tomcat site has docs on the servlet api if you need them so they might
shed some light on this behaviour as well.

Regards,
David

-----Original Message-----
From: pantichd [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 23, 2006 8:29 AM
To: user@struts.apache.org
Subject: [OT] request.getServletPath() val not same in Filter & Servlet



Hello,

Sorry for posting this in Struts mailing list but I can't seem to get an
answer on any other discussion groups. I've always had great results getting
good answers here so here goes...

I have a Filter in my app that uses the request.getServletPath() method to
get the name of the page being invoked without the context path.

This worked fine until I try to invoke a servlet. For example, if I invoke a
url like http://localhost/app1/servlet/package.ServletName the result of
calling request.getServletPath() is '/servlet'.

However, if I make the same call when I'm in the servlet the result is
'/servlet/package.ServletName'

Why does it give a different result in the filter and the servlet?

Thanks!

--
View this message in context:
http://www.nabble.com/-OT--request.getServletPath%28%29-val-not-same-in-Filt
er---Servlet-tf2152125.html#a5943443
Sent from the Struts - User forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to