cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject Generating a 404 Not Found
Date Tue, 08 Oct 2002 07:11:20 GMT
[I posted this message on cocoon-users two days ago, but got no reply. I 
hope you don't mind if I "escalate" this ;-)]

Hi people,

let's say you have a website with an administrative section that is 
protected using the Authentication Framework:

<map:match pattern="admin/**">

   <map:act type="auth-protect">
     <map:parameter name="handler" value="authhandler"/>

     <map:match pattern="admin/newuser">
       ...
     </map:match>

     <map:match pattern="admin/deluser">
       ...
     </map:match>

     <!-- more matchers here -->

   </map:act>

   <!--
      - if the user is not authenticated,
      - redirect him to the login page
     -->
   <map:redirect-to uri="login"/>

</map:match>

The problem here is that when someone requests an URI like 
"admin/this-uri-does-not-match-anything", they are redirected to the 
login page. I'd like to generate a "404 Not Found" result code instead, 
and possibly have it trapped by the map:handle-errors block.

I'm using C2.1-dev and I see there's a NotifyingGenerator, but I cannot 
figure out whether it would be useful in this case and how to use it.

Any hints?

     TIA,

         Ugo

-- 
Ugo Cei - http://www.beblogging.com/blog/



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message