hi all, i'm trying to have a filter which is applicable to only one Servlet. i'm having filter specification in web.xml correctly. in <filter-mapping> defined like,
and here is my servlet name tag,
but the filter on the servlet doesn't get invoked when i run the servlet. there is no error or exception. i'm using tomcat 4.0.1. but if i use <url-pattern>/*</url-pattern> tags then it works! any idea regarding this? or i'm specifying something wrong... regards maulin.
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
Are you accessing the Servlet thru the servlet-name and not using the package structure in the URL?
i'm using the package structure. otherwise it would have given me an error. i use http://localhost:6000/examples/servlet/myexamples.filters.FilterTestServlet to run the servlet and it is in myexamples.filters package. the problem i have is when i say <url-pattern>/*</url-pattern> then it works! i have tested this but only when i use servlet-name then it doesnt work WITHOUT GIVING ANY DAMN EXCEPTION OR ERROR regards maulin.
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
i use [URL=http://localhost:6000/examples/servlet/myexamples.filters.FilterTestServlet[http://localhost:6000/examples/servlet/myexamples.filters.FilterTestServlet[/URL] Thats what I thought. You have to use the servlet name not the package structure..... Good luck.
so its similar to <servlet-mapping>. right??? i thought servlet-name is a local ref in web.xml to ease the filter mapping task... got u... or i was going to use /examples/servlet/<packged-servlet-name> in web.xml in the <servlet-class> tag...i'll try will let u know... now again i've lost access of servlet env so here goes my sig.... regards maulin
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
i thought servlet-name is a local ref in web.xml Thats sounds dangerous. You need to better test this to get the concept. - satya