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

Properties file read problem in struts-config.xml

 
riddhi bhatt
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have declared in struts-config.xml, the following declaration:-

<message-resources parameter="resource.MessageResource" />

The location of the file is in JavaResource/resource

the jsp file trying to access it is in WebContent folder.

A brief code snippet is as follows:-



Any help is appreciated. I am new to struts.
 
jatan bhavsar
Ranch Hand
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Riddhi,

Try to put it into the web-inf folder.
Regards
Jatan
 
riddhi bhatt
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jatan bhavsar wrote:Hi Riddhi,

Try to put it into the web-inf folder.
Regards
Jatan


Did it for the resource file but of no avail.... .
 
echarish Kumar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What output are you getting on your page is it ??label.username?? , if you are getting this than it means your properties are not present in the properties file.
can you post complete code that you are using along with struts-config, jsp, and properties file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic