Search code examples
javapropertiesseamseam2

How to access *.properties file in Seam application


Is there a way to access properties files in seam app? I'm looking for some kind of resource loader..

Thanks in advance!


Solution

  • There is actually Seam native component - ResourceLoader which can be simply injected with @In and it gives an access to the property files via ResourceBundle.

    Example:

    import org.jboss.seam.core.ResourceLoader;
    ... 
    @In
    private ResourceLoader resourceLoader;
    ...
    resourceLoader.getResource("BUNDLE_NAME");