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 :)
Ulrich
--
Ulrich Mayring
DENIC eG, Systementwicklung
---------------------------------------------------------------------
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]>