jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kazuhito SUGURI <suguri.kazuh...@lab.ntt.co.jp>
Subject Re: 403 Forbidden
Date Mon, 28 Feb 2005 04:35:28 GMT
Hi Frederic,

In article <421F577D.2030400@sun.com>,
Fri, 25 Feb 2005 09:51:09 -0700,
Frederic Jean <Frederic.Jean@Sun.COM> wrote: 
Frederic> I'm trying to test an authorization type filter. Under some 
Frederic> circumstances, the filter has to return an HTTP response code of 403 
Frederic> (Forbidden).
Frederic> 

Frederic> When I try to test the filter under conditions where it should return a 
Frederic> 403, I get the following exception instead:
Frederic> 
Frederic>     [cactus] Testcase: testNoAssetId took 0.087 sec
Frederic>     [cactus]    Caused an ERROR
Frederic>     [cactus] Failed to get the test results at 
Frederic> [http://localhost:8880/delivery-cactus/test/filterRedirector.jsp]
Frederic>     [cactus] org.apache.cactus.util.ChainedRuntimeException: Failed to 
Frederic> get the test results at 

As a possible case, your web.xml may contains filter-mapping entry
which applies the filter to requests to the FilterRedirector,
http://localhost:8880/delivery-cactus/test/filterRedirector.jsp.
for this case. (I'm not sure why it has jsp suffix).
For example, if your web.xml have a filter-mapping entry like
    <filter-mapping>
        <filter-name>theFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
and theFilter can fail for the request from Cactus-client,
Cactus-client cannot get test results.


Codes are appending for an example.
You should not add filter and filter-mapping entries for the SampleFilter
to your web.xml to run this example successfully.
If you add entries like follows to web.xml, the test will be failed
as you encountered:
    <filter>
        <filter-name>sampleFilter</filter-name>
        <filter-class>SampleFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>sampleFilter</filter-name>
        <url-pattern>/FilterRedirector</url-pattern>
    </filter-mapping>


I hope this helps you.
----
Kazuhito SUGURI
mailto:suguri.kazuhito@lab.ntt.co.jp

Mime
View raw message