On 11.Jul.2001 -- 10:08 AM, Ulrich Mayring wrote:
> Carsten Ziegeler wrote:
> >
> > The right place for application flow and redirects is the sitemap in
> > c2. So you can make redirects in the sitemap using the map:redirect-to
> > element or you can write your custom action which can do a redirect.
>
> But how to do that conditionally then? Here's some code from one of my
> Cocoon1 apps:
>
> String param = request.getParameter("param");
> if (param == null||param.equals(""))
> response.sendRedirect("error.xml?apperror=1526");
>
> This redirects the user to an error page, if his input is not ok. I have
> lines like this in most of my XSP pages. Another example:
>
> if (status.startsWith("active")) {
> // Send notification mail
> response.sendRedirect("mail/NOTIFY_CUSTOMER.xml");
> else if (status.startsWith("begin")) {
> // Send error fax
> response.sendRedirect("fax/NOTIFY_CUSTOMER.xml");
>
> Doing a 'grep -r sendRedirect * | wc -l' on the above app I get 104.
> Does this mean I have to write 104 actions? Or is it possible to write a
> generic redirect action - in that case it should be included in the
> distribution :)
Have a look at the form validation action and request parameter value
selctor(*) provided with cocoon2
Chris.
(*) will appear today in HEAD
--
C h r i s t i a n H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>