Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Filter question

 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you accessing the Servlet thru the servlet-name and not using the package structure in the URL?

- satya
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

- satya
[ March 05, 2002: Message edited by: Madhav Lakkapragada ]
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic