You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by captain_rhino <gr...@axa-travel-insurance.com> on 2011/10/21 10:36:35 UTC

Page url rewrite

I understand how I can read from a query string ith Tapestry but how do i
write a query string of a specfic page request.


For example 

My initial request is

myapp/redirect?sourceSiteId=aUniqueValue

I use  @ActivationRequestParameter to capture the value of the parameter.

My redirect page then returns an instance of my page class
PolicySignin.class with a url of
myapp/policySignin

I would loike it to contain the values of the inital request parameters
passed in i.e.
myapp/policySignin?sourceSiteId=aUniqueValue

The reason is for bookmarking purposes.

I have looked at the transformPageRenderLink methods but do not know how to
pass a parmeter value through to this method.

thx for any assistance.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Page-url-rewrite-tp4924085p4924085.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: Page url rewrite

Posted by captain_rhino <gr...@axa-travel-insurance.com>.
Thankls for your advice.

I can see how you would capture request information using
ActivationRequestParameter  but cannot see how in a page context you would
add parameters in the same way that addparameter works on a link?

        Link link =
linkSource.createPageRenderLinkWithContext(PolicySignin.class);
        link.addParameter("x", "123");
        link.addParameter("y", "123");
        return link;     


Do you have an example?

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Page-url-rewrite-tp4924085p4924603.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: Page url rewrite

Posted by Dragan Sahpaski <dr...@gmail.com>.
Hi,
You can use ActivationRequestParameter
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/ActivationRequestParameter.html

It's basically the samo use case as PageActivationContext except you can
have more than one field annotated and it handles URL parameters, so the
object is encoded/decoded with a ValueEncoder etc.

Cheers,
Dragan Sahpaski



On Fri, Oct 21, 2011 at 11:37 AM, captain_rhino <
graeme.kitchen@axa-travel-insurance.com> wrote:

>
> I found a way of doing this unless anyone know any different.  Is there a
> way to this with the page object rather than using a link.
>
>    @Inject
>    private PageRenderLinkSource linkSource;
>
>    @Log
>    public Object onSubmitFromPolicySigninForm()
>    {
>        Link link =
> linkSource.createPageRenderLinkWithContext(PolicySignin.class);
>        link.addParameter("x", "123");
>        link.addParameter("y", "123");
>        return link;
>
>    }
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Page-url-rewrite-tp4924085p4924245.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: Page url rewrite

Posted by captain_rhino <gr...@axa-travel-insurance.com>.
I found a way of doing this unless anyone know any different.  Is there a
way to this with the page object rather than using a link.

    @Inject
    private PageRenderLinkSource linkSource;
	
    @Log
    public Object onSubmitFromPolicySigninForm()
    {
        Link link =
linkSource.createPageRenderLinkWithContext(PolicySignin.class);
        link.addParameter("x", "123");
        link.addParameter("y", "123");
        return link;     	
    	
    }

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Page-url-rewrite-tp4924085p4924245.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