cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaw, Chris" <>
Subject RE: Redirect to referrer
Date Fri, 28 Jun 2002 15:58:46 GMT
> Hi,
> I have several XSP pages which basically submit data to a generic action.
> When the action has finished I want the original page reloaded but with
> Form containing the data that was submitted.
> The XSP part of the equation I have got working ok with the tag:
> <xsp-request:get-parameter>
> (tested with a hard-coded entry in the sitemap).
> But how do I tell cocoon to return back to the referrer, written as XXXXX
> below.
>         <map:match pattern="store">
>             <map:act type="persist-action"> 
> 	            <map:generate type="serverpages" src="docs/XXXXX.xsp"/>
>                 <map:serialize type="html"/> 
>             </map:act> 
>         </map:match>   
> I have tried {target}, {referer}, {1}, {../1} but none of these have been
> successful.
> What is the correct way to do this?

you will need to write an action that returns the stripped down
referer attribute from request header.

in HEAD you can refer to the _complete_ referer URL with
{header:referer} but even then you'd need to strip it down.

another solution could be to use the referer matcher and fill the
pattern with enough "*"s. E.g.

         <map:match pattern="store">
             <map:act type="persist-action"> 
			    <map:match type="referer-match"
 	               <map:generate type="serverpages" src="docs/{1}.xsp"/>
                   <map:serialize type="html"/> 
                <map:match pattern="**"/>
                   <!-- what to do if the referer is not valid -->


Thanks for the reply, I'll give it a go.

I guess I need to find the last '/' and take everything after there.


PS - I'm surprised there isn't a simpler solution to do this, when it must
be a fairly common thing.....

Any e-mail message from the European Central Bank (ECB) is sent in good faith but shall neither
be binding nor construed as constituting a commitment by the ECB except where provided for
in a written agreement.
This e-mail is intended only for the use of the recipient(s) named above. Any unauthorised
disclosure, use or dissemination, either in whole or in part, is prohibited.
If you have received this e-mail in error, please notify the sender immediately via e-mail
and delete this e-mail from your system.

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message