Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Questions About Resource Bundles

 
Elle Atechsy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! It's working.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic