I'm building a little logging system that will create a record in a database
anytime one of about 20 different pages on my site is hit.  So there are now
say 20 different map:matches for these pages.  I don't want to insert some
kind of database call (ESQL, Action, other) in each map:match pattern since
that isn't very elegant nor maintainable.  So I need suggestions on good
Cocoon patterns or best practices that allow "something" to happen for a
specific set of map:match's.

I'm thinking maybe if I slightly modify my existing 20 patterns to always
start the same, e.g. in this case with the 'mypages' path:

<map:match pattern="mypages/somepath/about_this_site.html>
<map:match pattern="mypages/somepath/management.html>
<map:match pattern="mypages/somepath/services.html>

then I could create an additional new match like this, that every request
would go through first:

<map:match pattern=mypages/**/*.html>
        do the database call
        <map:redirect-to uri="mypages/{1}/{2}.html"/>
</map:match>

And then the redirect would send the request on to the next proper match.  

Will this work?  Is this the best way?

Thanks,
David


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to