aspose file tools*
The moose likes Struts and the fly likes Questions About Resource Bundles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Questions About Resource Bundles" Watch "Questions About Resource Bundles" New topic
Author

Questions About Resource Bundles

Elle Atechsy
Ranch Hand

Joined: Jan 23, 2004
Posts: 96
Hi,

I'm very new to Struts,as well as converting a Java MVC structured app into the Struts framework. And,in doing so, I am trying to convert a constants properties file into a messageResourceBundle file. My question is...

How do I access the attributes in the resource file from a class file? Or am I just down right off the mark, and cannot use the resource file that way?

It works when displaying a message from the resource file in a JSP page, but I can't figure out how to do it in a class file.

I appreciate any help.

Thanks,
Lulu
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

U can use the java.util.ResourceBundle will do the job for u ........but ofcourse if u want to access the resourcebundles of the struts ....it has a class named MessageResources which internally does the same job as java.util.ResourceBundle
Elle Atechsy
Ranch Hand

Joined: Jan 23, 2004
Posts: 96
Thank you! It's working.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Questions About Resource Bundles
 
Similar Threads
Struts questions!!
Specifying a message resource file within the Action class
Getting values from properties in validate-using multiple message-resources in struts
Http status 404 resource not available