You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Shaw, Chris" <Ch...@ecb.int> on 2002/06/28 17:13:36 UTC

Redirect to referrer

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 the
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?

...I know I can pass a parameter in containing the filename but then there
could be consistency problems if the filename changed....someone would have
to remember to change the param. So a built-in solution is obviously more
ideal.

Thanks IA

Chris

~~~~~~~~~~~~~~~~~~~~
Chris Shaw
> European Central Bank
> DG Information Systems
> * Chris.Shaw@ecb.int
~~~~~~~~~~~~~~~~~~~~


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.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Redirect to referrer

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 28.Jun.2002 -- 05:13 PM, Shaw, Chris wrote:
> 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 the
> 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" pattern="http://your.host.name.com/docs/*">
 	               <map:generate type="serverpages" src="docs/{1}.xsp"/>
                   <map:serialize type="html"/> 
                </map:match>
                <map:match pattern="**"/>
                   <!-- what to do if the referer is not valid -->
                </map:match>
             </map:act> 
         </map:match>   

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    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/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>