You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Zhou Jianquan <jq...@gmail.com> on 2010/12/07 15:20:42 UTC
Hello,How can I add a dynamic value in URL,just like encode current locale
for example,I have a value "myvalue",I want add it to url like below:
-
http://www.xxxx.com/en/myvalue/mypage
Re: Hello,How can I add a dynamic value in URL,just like encode
current locale
Posted by jqzone <jq...@gmail.com>.
Thanks for all your replies!
Actually,We are developing an application in Multi-Tenant mode,Every tenant
shares the same web domain.In a private network(every tenant login in before
use the app for example),tapestry works well.But now we meet a new
problem,our customers need to publish some pages to
SNS(FaceBook,twitter...),so I want to perssit the current tenant id into
urls ,In this way when people come from external links,we can know which tenant
they wants to see.
I have looked into tapestry's source code,the way tapesty deals
with encoding locale into path is just the way we want.So I want to know how
to implement this winthout changing tapestry's source code.
Can anyone help me ?
Re: Hello,How can I add a dynamic value in URL,just like encode
current locale
Posted by Everton Agner <to...@gmail.com>.
Well, this wouldn't be 100% dynamic, but you could make a page for each
value you wanna prepend, and consider the rest of it as Context values...
So, the page would setup some app configurations (that the page would read
to know what does it need to change) and redirect to the page (the context
value).
Ex:
URL : http://www.xxxx.com/en/myvalue/mypage
App root path : com.yourapp
Page : com.yourapp.pages.myvalue - MyValue.java
Context value : /mypage <http://www.xxxx.com/en/myvalue/mypage>
So, the MyValue.java page would setup some things and redirect to "
www.xxx.com/en/mypage"
Buuuut, i hope there is some magic and nice way of doing this that i don't
know...
_______________________
Everton Agner Ramos
2010/12/7 Mark <ma...@xeric.net>
> I think you want to look at the PageLink and the context parameter:
>
> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/PageLink.html
>
> You would pass mypage in as the context or the link.
>
> Does that do what you want?
>
> Mark
>
> On Tue, Dec 7, 2010 at 8:20 AM, Zhou Jianquan <jq...@gmail.com> wrote:
> > for example,I have a value "myvalue",I want add it to url like below:
> > -
> > http://www.xxxx.com/en/myvalue/mypage
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Hello,How can I add a dynamic value in URL,just like encode
current locale
Posted by Mark <ma...@xeric.net>.
I think you want to look at the PageLink and the context parameter:
http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/PageLink.html
You would pass mypage in as the context or the link.
Does that do what you want?
Mark
On Tue, Dec 7, 2010 at 8:20 AM, Zhou Jianquan <jq...@gmail.com> wrote:
> for example,I have a value "myvalue",I want add it to url like below:
> -
> http://www.xxxx.com/en/myvalue/mypage
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Hello,How can I add a dynamic value in URL,just like encode
current locale
Posted by Everton Agner <to...@gmail.com>.
what's your scenario? just curious.
_______________________
Everton Agner Ramos
2010/12/7 Zhou Jianquan <jq...@gmail.com>
> for example,I have a value "myvalue",I want add it to url like below:
> -
> http://www.xxxx.com/en/myvalue/mypage
>