> I have a desire to use a context where the delimeter for one of the values is 
> itself a '/'. For example:
> 
>       /docs/my/path/to/doc/document1/param1/param2

Do you mean that one of the parameters is the value "document/", if so will T5 
not URL encode this to the value "document%2F" ? (although StringValueEncoder, 
v5.0.18, does not appear to)

If it doesn't then presumably you can so that you end up with:

/docs/my/path/to/doc/document1%2F/param1/param2


I might have misunderstood what you are trying to do though.

-----Original Message-----
From: Alfie Kirkpatrick <alfie.kirkpatr...@ioko.com>
Reply-To: Tapestry users <users@tapestry.apache.org>
To: Tapestry users <users@tapestry.apache.org>
Subject: RE: T5: Passing named/structured-type params in URLs?
Date: Wed, 13 May 2009 12:53:31 +0100

I've been following this thread with interest and have a somewhat different 
requirement. I have a desire to use a context where the delimeter for one of 
the values is itself a '/'. For example:

        /docs/my/path/to/doc/document1/param1/param2

I can do this by hand in a page by having onActivate(EventContext ctx) and 
iterating the elements of the path. However, what if param2 is optional? Also, 
it means I have to do this work manually on every page.

I realise that to make this work more generally I'd need to have another kind 
of separator in there, eg:

        /docs/my/path/to/doc/document1/-/param1/param2

I'd might then have a signature like:

        void onActivate(DocPath path, Object param1, Object param2)

and have the T5 machinery encode/decode urls accordingly.

Is this possible or am I asking too much? This is all in a drive to having nice 
looking URLs...

A simpler alternative might be to simply use a different context value 
separater, eg. '-' for apps where the context values are themselves meaningful 
paths. Is this possible? This would lead to a url like:

        /docs/my/path/to/doc/document1-param1-param2

Which kind of works for me.

Thanks!
Alfie.

-----Original Message-----
From: Joel Halbert [mailto:j...@su3analytics.com] 
Sent: 12 May 2009 17:51
To: Tapestry users
Subject: Re: T5: Passing named/structured-type params in URLs?

Hi Andy,

The same Encoder could indeed be used across multiple pages.

Some pointers:

You need to create one of these:
http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/ValueEncoder.html
Look at the source for one of the existing implementation for ideas, e.g. 
StringEncoder

[snip]


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

Reply via email to