I've got a blockfilter, that blocks all access to anything but the only url
that's allowed and reroutes to an errorservlet.
I've also got a method filter that blocks invalid http methods, but when a
request to an invalid url is forwarded to an errorservlet, it's not
filtered through my httpmethodfilter.

I have no idea about your source code, but a filter, like a method, will
handle the returning thread from after the :
            filterChain.doFilter(servletRequest, servletResponse);


      <filter>
            <filter-name>MethodFilter</filter-name>

<filter-class>dk.maerskdata.custm.communication.filters.HttpMethodFilter</filter-class>
      </filter>
      <filter>
            <filter-name>BlockFilter</filter-name>

<filter-class>dk.maerskdata.custm.communication.filters.BlockFilter</filter-class>
            <init-param>
                  <param-name>ALLOWED_URL_HANDLE</param-name>
                  <param-value>/soap/servlet/handlerservlet</param-value>
            </init-param>
      </filter>

      <filter-mapping>
            <filter-name>BlockFilter</filter-name>
            <url-pattern>/*</url-pattern>
      </filter-mapping>

      <filter-mapping>
            <filter-name>MethodFilter</filter-name>
            <url-pattern>/*</url-pattern>
      </filter-mapping>



Med venlig hilsen

Kleth

------------------------------------------------------------------------------------------

Kristian A. Leth.
Systemsdeveloper, Maersk Data A/S.
--------------------------------------------------------------
Professionals are predictable;
the world is full of dangerous amateurs.
------------------------------------------------------------------------------------------




|---------+---------------------------->
|         |                            |
|         |             Wendy Smoak    |
|         |             <Wendy.Smoak@as|
|         |             u.edu>         |
|         |                            |
|         |             24-10-2002     |
|         |             23:34          |
|         |             Please respond |
|         |             to "Tomcat     |
|         |             Users List"    |
|         |                            |
|         |                            |
|---------+---------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                          |
  |       To: [EMAIL PROTECTED]                                           
                                          |
  |       cc:                                                                          
                                          |
  |       Subject:  Help with Filters                                                  
                                          |
  
>------------------------------------------------------------------------------------------------------------------------------|




I just learned about filters and managed to get one up and running in a few
minutes.  Amazing!

I originally had it mapped as:
<filter>
    <filter-name>webAuthFilter</filter-name>
    <filter-class>edu.asu.vpia.example.WebAuthFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>webAuthFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

It's working a little _too_ well.  I'm using Struts, and the filter seems
to
be getting hit repeatedly before I finally see the page appear.  My guess
is
that each 'forward' gets filtered.

I tried to change it to:
    <url-pattern>/*.do</url-pattern>

So that my initial "welcome" page won't get filtered, and so hopefully only
the initial /editContact.do hit will get filtered, and only once.
Unfortunately, this isn't working--
URL's like http://abc.def.ghi/dev/processContact.do aren't getting
filtered,
and neither are
ones with parameters in the URL:
http://abc.def.ghi/dev/editContact.do?contactKey=4100&action=edit

So I'm guessing I've done the url-pattern wrong, but all the examples I can
find just have /* to filter all requests.  I thought I saw a reference to
an
example app that uses filters, but I don't see it in the examples that came
with 4.1.12.

Thanks for any hints...

--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management






--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>

Reply via email to