hmm. I think it's going to be easier to write a new service that handles messages and picks up the messages from the application level properties file.

it's unfortunate that i can't get the tapestry service from hivemind, but I don't have a request and would prefer not to attach to an arbitrary component in this case.

Andreas thanks for the tips, at least i know there isn't an obvious solution!

Andreas Andreou wrote:
You need to inject ComponentMessagesSource
which has provides a
Messages getMessages(IComponent component)

The problem is that you have to provide a component to that method,
since that's how the correct resource bundle and also the correct
locale (component.getPage().getLocale() is used ) is identified

This ties your service to tapestry classes and also generally means
that you'll have
to have an active web request (i.e. your service won't be able to
function if it's
not directly triggered from a page or component call)

So,
1) I'd suggest (if possible) building the message at the web layer -
so, instead of
having your service return a message, have it return a message key (and perhaps
the message arguments).
2) if you dont mind tying to Tapestry and the service is called
directly by a component
pass the Message object as a parameter.


On Jan 29, 2008 12:31 AM, Paul Stanton <[EMAIL PROTECTED]> wrote:
anyone?


Paul Stanton wrote:
Hi All,

I have a service which does not have access to the request cycle etc
however I need to use the same messages used for the tapestry
components, preferrably from the same Object/Service as the one
available to pages. I've tried creating a setter method for the
service but it isn't populated by hivemind.

   public void setMessages(Messages messages)
   {
       this.messages = messages;
   }

Any suggestions?

Thanks, Paul.



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





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








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

Reply via email to