Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile 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.
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Questions About Resource Bundles