You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jay Liu <ja...@skrye.net> on 2008/01/01 21:36:21 UTC
Servlet Filter Not Intercepting?
Hi all,
I'm having a problem with filters. I setup filter to block access to a
resource unless the user is authenticated.
I've noticed that the resource is accessed then the filter kicks in and then
loads.
I thought filters were supposed to intercept the request before the resource
is accessed?
Is there something wrong with my xml configuration?
Thanks,
Jay
RE: Servlet Filter Not Intercepting?
Posted by Jay Liu <ja...@skrye.net>.
Thanks Martin,
The thing is, I only have one filter, and I believe the XML is specified
correctly. The behavior is something like:
Request -> target runs -> filter kicks in and I see the filter page.
I know the target gets a request because I see in the apache log a null
pointer exception.
I feel like there is something fundamental missing in my understanding of
either filters, request/response, forward/redirect or dochain.
I'll read the IBM link now.
Thanks again,
Jay
-----Original Message-----
From: Martin Gainty [mailto:mgainty@hotmail.com]
Sent: Tuesday, January 01, 2008 4:46 PM
To: Tomcat Users List
Subject: RE: Servlet Filter Not Intercepting?
2 things1) the order of filter-mapping DOES matter in web.xmlin other words
1st lexically is the first filter to fire 2)any pre-initialisation of the
filter should be accomplished in the init() method()
check out this link from
ibmhttp://www.ibm.com/developerworks/java/library/j-tomcat/
Martin______________________________________________Disclaimer and
confidentiality noteEverything in this e-mail and any attachments relates to
the official business of Sender. This transmission is of a confidential
nature and Sender does not endorse distribution to any party other than
intended recipient. Sender does not necessarily endorse content contained
within this transmission.> From: jay@skrye.net> To: users@tomcat.apache.org>
Subject: Servlet Filter Not Intercepting?> Date: Tue, 1 Jan 2008 15:36:21
-0500> > Hi all,> > > > I'm having a problem with filters. I setup filter to
block access to a> resource unless the user is authenticated.> > > > I've
noticed that the resource is accessed then the filter kicks in and then>
loads.> > > > I thought filters were supposed to intercept the request
before the resource> is accessed?> > > > Is there something wrong with my
xml configuration?> > > > Thanks,> > Jay>
_________________________________________________________________
Share life as it happens with the new Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_122007
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Servlet Filter Not Intercepting?
Posted by Martin Gainty <mg...@hotmail.com>.
2 things1) the order of filter-mapping DOES matter in web.xmlin other words 1st lexically is the first filter to fire 2)any pre-initialisation of the filter should be accomplished in the init() method()
check out this link from ibmhttp://www.ibm.com/developerworks/java/library/j-tomcat/
Martin______________________________________________Disclaimer and confidentiality noteEverything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.> From: jay@skrye.net> To: users@tomcat.apache.org> Subject: Servlet Filter Not Intercepting?> Date: Tue, 1 Jan 2008 15:36:21 -0500> > Hi all,> > > > I'm having a problem with filters. I setup filter to block access to a> resource unless the user is authenticated.> > > > I've noticed that the resource is accessed then the filter kicks in and then> loads.> > > > I thought filters were supposed to intercept the request before the resource> is accessed?> > > > Is there something wrong with my xml configuration?> > > > Thanks,> > Jay>
_________________________________________________________________
Share life as it happens with the new Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_122007