-
1. Re: SeamResourceBundle or injected messages are always null
babazs Feb 16, 2010 9:42 AM (in response to dish13)WEB-INf/classs should be a good place for this.
And you must define the following lines in the components.xml too:
<core:resource-loader>
<core:bundle-names>
<value>messages_first</value>
<value>messages_second</value>
</core:bundle-names>
</core:resource-loader> -
2. Re: SeamResourceBundle or injected messages are always null
dish13 Feb 16, 2010 11:37 AM (in response to dish13)I don't understand; why messagesfirst and messagessecond? I have only one property file (messages.properties).
-
3. Re: SeamResourceBundle or injected messages are always null
ranophoenix Feb 16, 2010 11:45 AM (in response to dish13)It was only an example (you can have more than one property file). In your case use:
<core:resource-loader>
<core:bundle-names>
<value>messages</value>
</core:bundle-names>
</core:resource-loader> -
4. Re: SeamResourceBundle or injected messages are always null
dish13 Feb 16, 2010 6:13 PM (in response to dish13)Yes, but my resource bundle is already define in my components.xml and still when I inject the messages is null.
I've tried @In(value="#{messages['test']}") private String testMsg; and I have no problems. -
5. Re: SeamResourceBundle or injected messages are always null
blabno Feb 17, 2010 9:14 AM (in response to dish13)Amy, please post your full class code where you do injection. For entire map of messages it should be :
@In private Map<String,String> messages;
I also do not understand the last sentence. Do you mean that injecting particular message works and injecting whole bundle fails ?
-
6. Re: SeamResourceBundle or injected messages are always null
dish13 Feb 25, 2010 8:02 PM (in response to dish13)Yes, I have no problems with injecting a particular message. I only have problems when injecting the message map.
Here's the class:
@Stateful @Name("pos") @Scope(ScopeType.CONVERSATION) @Interceptors( { org.jboss.seam.ejb.SeamInterceptor.class }) public class POSActionBean implements POSAction, Serializable { private static final long serialVersionUID = 20100125L; @Logger private Log log; @In StatusMessages statusMessages; @In EntityManager entityManager; @In(scope=ScopeType.SESSION) private Employee currEmployee; @In private Map<String, String> messages; @Begin(join = true, flushMode = FlushModeType.MANUAL) public String begin() { return "pos"; } public String next() { return "services"; } @End public String end() { return "end"; } @Destroy @Remove public void destroy() { }; }
-
7. Re: SeamResourceBundle or injected messages are always null
mgvanbochove Jun 23, 2011 5:26 PM (in response to dish13)Hi,
I had a simular problem. I think I know how you can solve your problem (unless you solved it already).
Change the lines which inject your messages Map with:@In(value="#{messages}")
private Map<String, String> messages;
You use a EJB (like I did). The EJB is not created by Seam and I think the @In doesn't work well for the built in resource bundle seam component configured in components.xml. Maybe this is a bug?
It also explains why injecting a single message works, because the el expression for messages is used.