[jboss-user] [JBoss Seam] - localization messages access from Java code

dnikolov do-not-reply at jboss.com
Thu Aug 16 12:38:36 EDT 2007


I am trying to access a message defined in my messages_en.properties file from my backing Java code per the instructions in the Seam manual in the localization/internationalization section. I am doing something like this:

@In("#{messages['l.someDbTable.usexCol']}") private String ORIENTATION_USEX;
@In("#{messages['l.someDbTable.useyCol']}") private String ORIENTATION_USEY;
private final SelectItem[] ORIENTATION_ITEMS = new SelectItem[] {
        new SelectItem(this.ORIENTATION_USEX),
        new SelectItem(this.ORIENTATION_USEY)

Doing this results in a NullPointerException at the SelectItem array declaration. I am assuming I need to specify what messages is somewhere in an xml config file.

Note that I can refer to messages in my xhtml front end code as in: #{messages['l.someDbTable.useyCol']}

In my faces_config.xml I have this :


but I am not sure how relevant this is. Can you provide a solution or a more detailed source on using localization in Seam? Thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074913#4074913

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074913

More information about the jboss-user mailing list