Dear List,

I am currently buidling an ordinary booking application. When a customer books 
something I collect everything in a Booking object. I display the data in a 
page BookingSummary, which contains a link "confirm booking". When booking is 
confirmed I want to create a confirmation email to be sent to the customer. For 
this purpose I wrap everything in a ConfirmationMail object.
 
As one might guess there is the same need for localization in the 
ConfirmationMail as in the BookingSummary. So I would like to use the same 
mechanism of localized message catalogues, namely Tapestry´s.

My first idea was to implement ConfirmationMail as a component so I could use 
@Inject Messages. This turned out to be a dead end, because i ended up with 
Tapestry complaining me not using the component in the page template.

My second idea was to implement a service and use the help of ioc-Container. I 
have read the ioc-manual and think I should be implementing a build method in 
AppModule like the following. 

public static ConfirmationMail buildConfirmationMail(Messages messages, Booking 
booking) {
  return new ConfirmationMail(messages, booking);
}

What I am asking first is, where does tapestry know how to choose the right 
message catalogue?

And secondly as far as I understand only services can be parameters to build 
methods. Am I wrong or do I have to make my Booking class a service?

I think this is quite a common use case so would someone be so kind and put me 
on the right track with this? 

Thanks in advance, nillehammer


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

Reply via email to