Hi Angelo,

You can accomplish this by using Delegates.  Put a Delegate on your
index page, and in your Index.java, put a getter for that delegate.  The
delegate may return a block from one of any number of other pages.

See http://wiki.apache.org/tapestry/Tapestry5HowToCreateATabPanel .

Andy

On Fri, 2008-08-15 at 01:12 -0700, Angelo Chen wrote:
> Hi,
> 
> I'm trying to some url rewriting in the Index.java:
> 
> I have this:
> http://mydomain.com/item/123
> 
> which displays item 123, now if user type url:http://mydomain.com/123, I'll
> forward it in onActivate to /item/123 as follows:
> 
> Object onActivate(Object[] obj) {
>       if (obj.length > 0) {
>           String code = (String) obj[0];
>               return
> resources.createPageLink(Utils.getClassBaseName(Item.class.getName()), true,
> code);
>       } else
>               return Home.class;
>   }
> 
> 
> This works well, however, a little problem:
> 
> when user type: http://mydomain.com/123
> url displayed in the browser is http://mydomain.com/item/123
> 
> is there a way to just keep it like http://mydomain.com/123 in the browser?
> 
> Thanks,
> 
> Angelo



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to