Home > Jboss Seam > How to read values from properties file in JBoss Seam

How to read values from properties file in JBoss Seam

Let us assume we have two properties files namely  messages.properties and application.properties

In components.xml we place the below line

<core:resource-loader bundle-names=”messages application”/>

Then in the Seam component where we want to retrieve the value for a given property (key), we inject the ResourceBundle as below.

   @In
    java.util.ResourceBundle resourceBundle;

The retrieval is done as below

String imagesLocation = resourceBundle.getString(“IMAGESLOCATION”);
Advertisements
Categories: Jboss Seam Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: