I have a special action that loads pages that extends the ActionSupport class. This allows me to access properties file values using the getText() method. My action requires a list of files to be loaded for any page.
I know that this is possible using the Configuration object: Loading a list of values from a properties file
public class MainAction extends ActionSupport{
..
..
public String loadHomepage() throws Exception {
page.setPageTitle(getText("homePage.title"));
page.setCssFiles(getText("homePage.cssFiles"));
page.setJsFiles(getText("homePage.jsFiles"));
return INPUT;
}
..
..
}
MainAction.properties
homePage.title=Home Page
homePage.cssFiles=a.css,b.css,c.css
homePage.jsFiles=a.js,b.js,c.js
I know that an obvious way would be to get the list and then split it manually by using comma as the delimiter. But is there any faster/cleaner way in struts2 to obtain these list of properties?