Hello,
I'm still learning Tapestry, and generally Java Web Application ...
Now I can understand a beat about Tapestry and create little working project. Here is the time for me to learn how to manage errors, like trapping an underground exception in the view layer.

The following example is from the "Kent Tong 's book" source code: the "shop" example. There is a page to view shop's products details: ProductDetails(.html,.page,.java).

In ProductDetails.java there are accessors for a product details like :
   public String getName() {
       return lookup().getName();
   }
   public String getDesc() {
       return lookup().getDesc();
   }
   public double getPrice() {
       return lookup().getPrice();
   }
The lookup method to get a Product is :
   private Product lookup() {
       return Catalog.getGlobalCatalog().lookup(getProductId());
   }

In ProductDetails.page there are components like :
   <component id="name" type="Insert">
       <binding name="value" value="name"/>
   </component>
   <component id="desc" type="Insert">
       <binding name="value" value="desc"/>
   </component>
   <component id="price" type="Insert">
       <binding name="value" value="price"/>
   </component>

How can I catch an exception throwed by Catalog.getGlobalCatalog().lookup(getProductId()) when a ProductId is not valid (does not exists) ? I would like to display a nicer page than the default Tapestry's Exception page. The problem is that the exception occurs while parsing the ProductDetails's specification page (ProductDetails.page) where components are binded.

Have you got any idea or method on how to manage that kind of problems ?

thanks a lot for your experience share.
Cyrille.



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

Reply via email to