Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to access resource file configured in struts-config.xml

 
Viju Purushothaman
Greenhorn
Posts: 1
Java jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Please help me with my following issue.

I have configured message resource in my struts-config.xml and now I need to access the resource properties from java file?
For the time being I am using the following code to access the resource properties.

protected static MessageResources messages = MessageResources.getMessageResources("resources.myfile");
where "myfile.properties" under "resources" package is my resource file.

But I don't want to specify the file name ("resource.myfile" in my case) inside java code instead I would like to access the object that is being configured in struts-config.xml.
Something similar in the <bean:write> code.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic