Stephane Decleire wrote:
If i understand well your configuration file, you encapsulate the
Spring bean messageSource in the class
SpringMessageSourceBasedComponentMessagesSource managed by Hivemind.
So messageSource is defined as a classic Spring bean in your
contextApplication file.
Correct. It's Spring's MessageSource mechanism, because I wanted to
avoid having to define all my resource bundles twice - once for Spring
and once for Hivemind. I went with Spring rather than Hivemind because I
have other parts of the system that only involve Spring and no Tapestry.
And how do you inject the bean in your Tapestry page ?
Well, this is a special case I guess, because the MessagesSource
mechanism is already there in all Tapestry pages anyway. I am not adding
something new, just using a different implementation.
But maybe you can try to use the same <set-object ...
value="spring:..."> notation for whatever else you want to do in a
similar fashion.
I don't really know how Hivemind and its configuration works either, so
I'm sorry if I can;t be of more help...
Mark wrote:
Are you using the tapestry-spring jar? I think that works for me,
using this syntax:
<implementation service-id="tapestry.ComponentMessagesSource">
<invoke-factory>
<construct
class="com.mark_arnold.util.web.tapestry.SpringMessageSourceBasedComponentMessagesSource">
<set-object property="messageSource"
value="spring:messageSource"/>
</construct>
</invoke-factory>
</implementation>
Hope this helps you...
MARK
Stephane Decleire wrote:
I've tried to import my Spring bean User in Hivemind using
SpringLookupFactory without success.
Has anybody use this integration ? And could show me a sample of
hivemind configuration ?
Thanks in advance.
Stephane Decleire wrote:
Hi,
I need a User component in a Tapestry form like this :
@Persist("client")
public abstract void setUser(User user);
public abstract User getUser();
But my User component use Spring IoC to get its Address class.
Without a Spring declaration, the Address of my User isn't
instantiated so I get a null Error when I use it in my Form :
<component id="street" type="TextField">
<binding name="value" value="user.address.street"/>
<binding name="displayName" value="message:street-label"/>
<binding name="validators"
value="validators:required,maxLength=100"/>
</component>
So i should also have declaration in my page so that Spring could
inject the Address in my User object like :
@InjectSpring("user")
public abstract User getUser();
public abstract void setUser(User user);
How can i mix the Tapestry and Spring declarations in my page ?
---------------------------------------------------------------------
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]