You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John Smith <se...@hotmail.com> on 2006/01/15 07:19:21 UTC

using meta http-equiv="Refresh" content="n;url"

Is there a clean way to do an html page redirect? I see that on the Shell 
component I can specify a refresh for the page, but I don't see a redirect.

I could write a delegate for the Shell component, but I already have a 
delegate that is writing stuff to the head tag. I suppose I could make my 
existing delegate be able to itself take a delegate and sort of chain them 
together. Or I guess I could write a custom Shell component that takes an 
array of delegates.

Anyone have any experience of advice with this?



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: using meta http-equiv="Refresh" content="n;url"

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Sunday 15 January 2006 21:51, John Smith wrote:
> I could change my existing delegate to do more than write the style tags
> (which is what it is currently doing), but that sort of deviates from the
> object-oriented approach. Also, I only need to do the html page redirect on
> some pages, whereas the style tags are written on every page. And I don't
> know if I like changing my Border component to also have page flow logic.

I was only illustrating writing into the header area some attributes.

Everything is driven off parameters into the component.  In this particular 
case I chose to grab the URL for the css file out of my application 
properties file, but there is no reason why you couldn't pass in a redirect 
URL string as a component parameter, which was not output when the value is 
null.  That way, the page which calls the component decides if it wants a 
redirect not your component.
>
> ----Original Message Follows----
> From: Alan Chandler <al...@chandlerfamily.org.uk>

> by java class for this component has
>
> 	private class siteCSS implements IRender {
> 		public void render(IMarkupWriter writer, IRequestCycle cycle) {
> 			writer.beginEmpty("link");
> 			writer.attribute("rel","stylesheet");
> 			writer.attribute("type","text/css");
> 			writer.attribute("href",appMessage("cssURL"));
> 			writer.println();
> 		}
> 	}
>
> (appmessage does something like getPage().getMessages().getMessage() )
> Why can't you just add the writing sections into your existing delegate?
>

-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: using meta http-equiv="Refresh" content="n;url"

Posted by John Smith <se...@hotmail.com>.
I could change my existing delegate to do more than write the style tags 
(which is what it is currently doing), but that sort of deviates from the 
object-oriented approach. Also, I only need to do the html page redirect on 
some pages, whereas the style tags are written on every page. And I don't 
know if I like changing my Border component to also have page flow logic.

----Original Message Follows----
From: Alan Chandler <al...@chandlerfamily.org.uk>
Reply-To: "Tapestry users" <ta...@jakarta.apache.org>
To: tapestry-user@jakarta.apache.org
Subject: Re: using meta http-equiv="Refresh" content="n;url"
Date: Sun, 15 Jan 2006 14:16:10 +0000
MIME-Version: 1.0
Received: from mail.apache.org ([209.237.227.199]) by 
bay0-mc6-f9.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Sun, 15 
Jan 2006 06:16:20 -0800
Received: (qmail 3781 invoked by uid 500); 15 Jan 2006 14:16:18 -0000
Received: (qmail 3770 invoked by uid 99); 15 Jan 2006 14:16:18 -0000
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49)    by 
apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jan 2006 06:16:18 -0800
Received: pass (asf.osuosl.org: domain of alan@chandlerfamily.org.uk 
designates 195.188.213.6 as permitted sender)
Received: from [195.188.213.6] (HELO smtp-out3.blueyonder.co.uk) 
(195.188.213.6)    by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Jan 2006 
06:16:18 -0800
Received: from home.chandlerfamily.org.uk ([82.44.22.127]) by 
smtp-out3.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Sun, 15 
Jan 2006 14:16:56 +0000
Received: from kanger.home ([192.168.0.21])by home.chandlerfamily.org.uk 
with esmtp (Exim 4.50)id 1Ey8fk-0006ee-7dfor 
tapestry-user@jakarta.apache.org; Sun, 15 Jan 2006 14:15:56 +0000
X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
Mailing-List: contact tapestry-user-help@jakarta.apache.org; run by ezmlm
Precedence: bulk
List-Unsubscribe: <ma...@jakarta.apache.org>
List-Help: <ma...@jakarta.apache.org>
List-Post: <ma...@jakarta.apache.org>
List-Id: "Tapestry users" <tapestry-user.jakarta.apache.org>
Delivered-To: mailing list tapestry-user@jakarta.apache.org
X-ASF-Spam-Status: No, hits=-0.0 required=10.0tests=SPF_PASS
X-Spam-Check-By: apache.org
User-Agent: KMail/1.9.1
References: <BA...@phx.gbl>
X-OriginalArrivalTime: 15 Jan 2006 14:16:56.0164 (UTC) 
FILETIME=[571DC240:01C619DE]
X-Virus-Checked: Checked by ClamAV on apache.org
Return-Path: 
tapestry-user-return-31169-semerau=hotmail.com@jakarta.apache.org

On Sunday 15 January 2006 06:19, John Smith wrote:
 > Is there a clean way to do an html page redirect? I see that on the Shell
 > component I can specify a refresh for the page, but I don't see a 
redirect.
 >
 > I could write a delegate for the Shell component, but I already have a
 > delegate that is writing stuff to the head tag. I suppose I could make my
 > existing delegate be able to itself take a delegate and sort of chain 
them
 > together. Or I guess I could write a custom Shell component that takes an
 > array of delegates.

I have a border component that I made that is writing an extra stylesheet 
link
into the header.  Perhaps you could do something similar?

The shell component call has this
<html jwcid="@Shell" stylesheet="ognl:pageStyle" title="ognl:siteTitle"
delegate="ognl:siteCSS">

by java class for this component has

	private class siteCSS implements IRender {
		public void render(IMarkupWriter writer, IRequestCycle cycle) {
			writer.beginEmpty("link");
			writer.attribute("rel","stylesheet");
			writer.attribute("type","text/css");
			writer.attribute("href",appMessage("cssURL"));
			writer.println();
		}
	}

(appmessage does something like getPage().getMessages().getMessage() )
Why can't you just add the writing sections into your existing delegate?


--
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: using meta http-equiv="Refresh" content="n;url"

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Sunday 15 January 2006 06:19, John Smith wrote:
> Is there a clean way to do an html page redirect? I see that on the Shell
> component I can specify a refresh for the page, but I don't see a redirect.
>
> I could write a delegate for the Shell component, but I already have a
> delegate that is writing stuff to the head tag. I suppose I could make my
> existing delegate be able to itself take a delegate and sort of chain them
> together. Or I guess I could write a custom Shell component that takes an
> array of delegates.

I have a border component that I made that is writing an extra stylesheet link 
into the header.  Perhaps you could do something similar?

The shell component call has this
<html jwcid="@Shell" stylesheet="ognl:pageStyle" title="ognl:siteTitle" 
delegate="ognl:siteCSS">

by java class for this component has

	private class siteCSS implements IRender {
		public void render(IMarkupWriter writer, IRequestCycle cycle) {
			writer.beginEmpty("link");
			writer.attribute("rel","stylesheet");
			writer.attribute("type","text/css");
			writer.attribute("href",appMessage("cssURL"));
			writer.println();
		}
	}

(appmessage does something like getPage().getMessages().getMessage() )
Why can't you just add the writing sections into your existing delegate?


-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org