Hi Hilico,

ok this is possible. But than I have at least one big if-then-else
statement in my page and that page has both components loaded, a grid
and a beandisplay (if we stay simple). If I use two separate pages, I
have no if-then-else nightmare and my pages are much lighter. 

Additionally I would like to add some more requirements to my URL
scheme. So that I have:

* /articles               HTTP 301      Location: /articles/
* /articles/              HTTP 200      list all articles
* /articles/{a-id}        HTTP 301      Location: /articles/{a-id}/
* /articles/{a-id}/       HTTP 200      list article with id a-id
* /articles/{a-id}/       HTTP 404      if there is no such article 

Only the 301's are redirects. The 404 have to be a normal response. I
think I could implement the 404 case with a layout component which
doesn't output the normal content body but instead outputs some error
message. The 301's could be handled by every filter but the link
generation with this trailing slash is not so easy. I know, I can advice
the method ComponentEventLinkEncoder#createPageRenderLink(..) but it
would be nice, if there will be some config option on
ComponentEventLinkEncoder regarding this.


Regards
Alex
 

On Sun, 2010-02-21 at 10:46 -0800, Hilco Wijbenga wrote:
> On 21 February 2010 02:11, Alexander Kiel <alexanderk...@gmx.net> wrote:
> > * /articles/                         list all articles available
> > * /articles/{a-id}/                  show one article
> > * /customers/                        list all customers
> > * /customers/{c-id}/                 show one customer
> > * /customers/{c-id}/orders/          list all orders of the customer
> > * /customers/{c-id}/orders/{o-id}/   show one order of the customer
> 
> You could simply check in the onActivate of your Articles page whether
> you have received a context or not. Set a boolean and use that in your
> tml to determine what to display.
> 
> I don't know if you can (easily) mix and match page names and contexts
> as in customers/c-id/orders/o-id. I've never tried that.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to