You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by spiderbarker <ji...@usa.net> on 2010/04/22 22:42:11 UTC

Add parameter to a generated redirect link

If I have a page that includes a passed parameter and that page has a form,
when a validation error occurs the redirect link no longer contains the
parameter in the query string of the original URL.

For example:

This URL brings up a form:
http://example.com/Item?itemno=1251092

If the user clicks submit (POST) and a validation error occurs the page is
redisplayed with 
a url that looks like this:
http://example.com/Item

As a redirect from a POST, this makes sense,  but what I'd like to do is add
the parameter, or somehow display the original URL in the client.  This way
if a user clicks submit and gets a validation error,  they can still get a
valid bookmark.

Thanks,

Jim
-- 
View this message in context: http://old.nabble.com/Add-parameter-to-a-generated-redirect-link-tp28334382p28334382.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Add parameter to a generated redirect link

Posted by Josh Canfield <jo...@gmail.com>.
My first thought would be to handle onFailure and return the Link with
the parameters added.

 @Inject
 private PageRenderLinkSource _linkSource;

Object onFailureFromMyForm() {
        final Link link = _linkSource.createPageRenderLink(Index.class);
        link.addParameter("intemno", "1251092");
        return link;
    }


Josh

On Thu, Apr 22, 2010 at 1:42 PM, spiderbarker <ji...@usa.net> wrote:
>
> If I have a page that includes a passed parameter and that page has a form,
> when a validation error occurs the redirect link no longer contains the
> parameter in the query string of the original URL.
>
> For example:
>
> This URL brings up a form:
> http://example.com/Item?itemno=1251092
>
> If the user clicks submit (POST) and a validation error occurs the page is
> redisplayed with
> a url that looks like this:
> http://example.com/Item
>
> As a redirect from a POST, this makes sense,  but what I'd like to do is add
> the parameter, or somehow display the original URL in the client.  This way
> if a user clicks submit and gets a validation error,  they can still get a
> valid bookmark.
>
> Thanks,
>
> Jim
> --
> View this message in context: http://old.nabble.com/Add-parameter-to-a-generated-redirect-link-tp28334382p28334382.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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