cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Björn Lütkemeier <bluetkeme...@s-und-n.de>
Subject RE: Allow redirects inside error handling
Date Wed, 30 Apr 2003 06:08:55 GMT
Hi,

> -----Original Message-----
> From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> Sent: Tuesday, April 29, 2003 6:38 PM
> To: cocoon-dev@xml.apache.org
> Subject: Re: Allow redirects inside error handling
>
>
>
> Björn Lütkemeier wrote, On 29/04/2003 16.42:
> ...
> > Sorry, but I did not find any convincing argument in the discussion why
> > redirects should be impossible.
>
> Tell me why you need them, maybe I can understand.
>
> --
> Nicola Ken Barozzi                   nicolaken@apache.org
>              - verba volant, scripta manent -
>     (discussions get forgotten, just code remains)
> ---------------------------------------------------------------------
>

It's quite simple to explain. We have a customer, that has to do the
following within his web application:

<map:pipeline>
	<map:match pattern="showForm">
		<!-- show a web form -->
	</map:match>
	<map:handle-errors>
		<map:select type="exception">
			<map:when test="x">
				<map:redirect-to uri="cocoon:/x-error"/>
			</map:when>
			<map:when test="y">
				<map:redirect-to uri="cocoon:/y-error"/>
			</map:when>
		</map:select>
	</map:handle-errors>
</map:pipeline>

<map:pipeline>
	<map:match pattern="formSubmitted">
		<!-- process form values -->
	</map:match>
	<map:handle-errors>
		<map:select type="exception">
			<map:when test="validationFailed">
				<map:redirect-to uri="cocoon:/showForm"/> <!-- redisplay form -->
			</map:when>
			<map:when test="x">
				<map:redirect-to uri="cocoon:/x-error"/>
			</map:when>
			<map:when test="z">
				<map:redirect-to uri="cocoon:/z-error"/>
			</map:when>
		</map:select>
	</map:handle-errors>
</map:pipeline>

<map:pipeline>
	<map:match pattern="x-error">
		...
	</map:match>
	<map:match pattern="y-error">
		...
	</map:match>
	<map:match pattern="z-error">
		...
	</map:match>
</map:pipeline>

Regards, Björn.


Mime
View raw message