You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Kent Tong <ke...@cpttm.org.mo> on 2005/03/02 03:29:39 UTC
Re: refreshing a page
Jer Kah <jerkah <at> gmail.com> writes:
> On the first page, there's an 'edit' button in each row that takes the
> user to the second page. Depending on what type of data that row has,
> the second page either allows them to edit that particular item or
> insert a copy of that item with the changes they made. After they hit
> "OK" on that second page to accept the changes, they're taken back to
> the first page.
Can you throw a RedirectException (not PageRedirectException) to
redirect them to the first page? This way, the first page is
the result of a GET, not a POST.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: refreshing a page
Posted by Jer Kah <je...@gmail.com>.
Just in case someone else is having this problem, it looks like you
have to add ".getURL()" to the end - so you end up with
throw new RedirectException(
getEngine().getService(Tapestry.PAGE_SERVICE).
getLink(cycle, null, new String[]{"pageName"}).getURL());"
The constructor 'RedirectException(ILink)' is undefined - it's
expecting a string.
On Wed, 2 Mar 2005 23:16:22 -0500, Bryan Lewis <br...@maine.rr.com> wrote:
> Good point!
>
>
> ----- Original Message -----
> From: "Kent Tong" <ke...@cpttm.org.mo>
> To: <ta...@jakarta.apache.org>
> Sent: Wednesday, March 02, 2005 8:26 PM
> Subject: Re: refreshing a page
>
> > Jer Kah <jerkah <at> gmail.com> writes:
> >
> > >
> > > Perfect! Thank you all very much. Using
> > > "/myappname/app?service=page/pageName" was exactly what I was looking
> > > for.
> >
> > Well, while this may work but it is not taking care
> > of maintaining the session id if the cookie is disabled,
> > nor is it portable to future versions of Tapestry.
> >
> > A better way is :
> >
> > throw new RedirectException(
> > getEngine().getService(Tapestry.PAGE_SERVICE).
> > getLink(cycle, null, new String[]{"pageName"}));
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: refreshing a page
Posted by Bryan Lewis <br...@maine.rr.com>.
Good point!
----- Original Message -----
From: "Kent Tong" <ke...@cpttm.org.mo>
To: <ta...@jakarta.apache.org>
Sent: Wednesday, March 02, 2005 8:26 PM
Subject: Re: refreshing a page
> Jer Kah <jerkah <at> gmail.com> writes:
>
> >
> > Perfect! Thank you all very much. Using
> > "/myappname/app?service=page/pageName" was exactly what I was looking
> > for.
>
> Well, while this may work but it is not taking care
> of maintaining the session id if the cookie is disabled,
> nor is it portable to future versions of Tapestry.
>
> A better way is :
>
> throw new RedirectException(
> getEngine().getService(Tapestry.PAGE_SERVICE).
> getLink(cycle, null, new String[]{"pageName"}));
>
>
>
> ---------------------------------------------------------------------
> 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: refreshing a page
Posted by Kent Tong <ke...@cpttm.org.mo>.
Jer Kah <jerkah <at> gmail.com> writes:
>
> Perfect! Thank you all very much. Using
> "/myappname/app?service=page/pageName" was exactly what I was looking
> for.
Well, while this may work but it is not taking care
of maintaining the session id if the cookie is disabled,
nor is it portable to future versions of Tapestry.
A better way is :
throw new RedirectException(
getEngine().getService(Tapestry.PAGE_SERVICE).
getLink(cycle, null, new String[]{"pageName"}));
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: refreshing a page
Posted by Jer Kah <je...@gmail.com>.
Perfect! Thank you all very much. Using
"/myappname/app?service=page/pageName" was exactly what I was looking
for.
On Wed, 2 Mar 2005 08:51:58 -0500, Bryan Lewis <br...@maine.rr.com> wrote:
> This address string has worked in my uses of a RedirectException to one of
> my app's IExternalPages:
>
> throw new RedirectException("/myappname/app?service=external/" +
> pageName);
>
> In your case, redirecting to a non-external page, try this:
>
> /myappname/app?service=page/pageName
>
> You can experiment by typing directly into the browser's address bar. When
> you get a string that works, drop the leading "http://localhost".
>
>
> ----- Original Message -----
> From: "Jer Kah" <je...@gmail.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Wednesday, March 02, 2005 8:35 AM
> Subject: Re: refreshing a page
>
> > I'm willing to try it, if you can tell me what RedirectException's
> > constructor is expecting as a parameter... I've tried passing in the
> > the name of page I want to redirect to, but all I get is:
> >
> >
> > HTTP Status 404 - /myApp/thePageIWantToRedirectTo
> >
> > --------------------------------------------------------------------------
> ------
> >
> > type Status report
> >
> > message /myApp/thePageIWantToRedirectTo
> >
> > description The requested resource (/myApp/thePageIWantToRedirectTo)
> > is not available.
> >
> >
> > Any help?
> >
> > Thanks,
> > Jer
> >
> >
> >
> > On Wed, 2 Mar 2005 02:29:39 +0000 (UTC), Kent Tong <ke...@cpttm.org.mo>
> wrote:
> > > Jer Kah <jerkah <at> gmail.com> writes:
> > >
> > > > On the first page, there's an 'edit' button in each row that takes the
> > > > user to the second page. Depending on what type of data that row has,
> > > > the second page either allows them to edit that particular item or
> > > > insert a copy of that item with the changes they made. After they hit
> > > > "OK" on that second page to accept the changes, they're taken back to
> > > > the first page.
> > >
> > > Can you throw a RedirectException (not PageRedirectException) to
> > > redirect them to the first page? This way, the first page is
> > > the result of a GET, not a POST.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: refreshing a page
Posted by Bryan Lewis <br...@maine.rr.com>.
This address string has worked in my uses of a RedirectException to one of
my app's IExternalPages:
throw new RedirectException("/myappname/app?service=external/" +
pageName);
In your case, redirecting to a non-external page, try this:
/myappname/app?service=page/pageName
You can experiment by typing directly into the browser's address bar. When
you get a string that works, drop the leading "http://localhost".
----- Original Message -----
From: "Jer Kah" <je...@gmail.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, March 02, 2005 8:35 AM
Subject: Re: refreshing a page
> I'm willing to try it, if you can tell me what RedirectException's
> constructor is expecting as a parameter... I've tried passing in the
> the name of page I want to redirect to, but all I get is:
>
>
> HTTP Status 404 - /myApp/thePageIWantToRedirectTo
>
> --------------------------------------------------------------------------
------
>
> type Status report
>
> message /myApp/thePageIWantToRedirectTo
>
> description The requested resource (/myApp/thePageIWantToRedirectTo)
> is not available.
>
>
> Any help?
>
> Thanks,
> Jer
>
>
>
> On Wed, 2 Mar 2005 02:29:39 +0000 (UTC), Kent Tong <ke...@cpttm.org.mo>
wrote:
> > Jer Kah <jerkah <at> gmail.com> writes:
> >
> > > On the first page, there's an 'edit' button in each row that takes the
> > > user to the second page. Depending on what type of data that row has,
> > > the second page either allows them to edit that particular item or
> > > insert a copy of that item with the changes they made. After they hit
> > > "OK" on that second page to accept the changes, they're taken back to
> > > the first page.
> >
> > Can you throw a RedirectException (not PageRedirectException) to
> > redirect them to the first page? This way, the first page is
> > the result of a GET, not a POST.
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: refreshing a page
Posted by Jer Kah <je...@gmail.com>.
I'm willing to try it, if you can tell me what RedirectException's
constructor is expecting as a parameter... I've tried passing in the
the name of page I want to redirect to, but all I get is:
HTTP Status 404 - /myApp/thePageIWantToRedirectTo
--------------------------------------------------------------------------------
type Status report
message /myApp/thePageIWantToRedirectTo
description The requested resource (/myApp/thePageIWantToRedirectTo)
is not available.
Any help?
Thanks,
Jer
On Wed, 2 Mar 2005 02:29:39 +0000 (UTC), Kent Tong <ke...@cpttm.org.mo> wrote:
> Jer Kah <jerkah <at> gmail.com> writes:
>
> > On the first page, there's an 'edit' button in each row that takes the
> > user to the second page. Depending on what type of data that row has,
> > the second page either allows them to edit that particular item or
> > insert a copy of that item with the changes they made. After they hit
> > "OK" on that second page to accept the changes, they're taken back to
> > the first page.
>
> Can you throw a RedirectException (not PageRedirectException) to
> redirect them to the first page? This way, the first page is
> the result of a GET, not a POST.
>
>
> ---------------------------------------------------------------------
> 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