I guess the way to achieve filtering is in ur filter mapping in the Deployment Descriptor,add <servlet-name> element & give ur servlets name there. Then use the url of ur servlets as if u would use it in the absence of filter.the webserver will automatically introduce the filter there.
1) In the initial posting there is no <servlet-mapping> tag. How would the container be able to map the request to the servlet.
2) If we user <servlet-name> instead of <url-pattern> in the <filter-mapping> tag, would that suffice ? Dont we need to explicitly have a <servlet-mapping> tag irrespective of whether we use a filter or not ?
I tried specifying <servlet-name> in <filter-mapping> tag without a <servlet-mapping> tag in web.xml - it didnt work - got the same exception - "Request resource not found."
Joined: Sep 04, 2005
the things I hv given for filter are only the addition to the normal web.xml settings tht r required for the normal servlet without filter.
u'll still require the servlet related elements present in the web.xml like <servlet-mapping> explicitely irrespective of whether we use a filter or not as u said.
configure ur serlvet for just as in the normal case as if theres no filter,access it like tht way only. but add the filter related things tht I hv mentioned above.