File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes resource bundle location - struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "resource bundle location - struts 2" Watch "resource bundle location - struts 2" New topic
Author

resource bundle location - struts 2

Anand Sivathanu
Ranch Hand

Joined: Jun 25, 2010
Posts: 76
Hi Friends,

I am new to struts 2.

I have create a sample struts 2 application...


Project structure is

LoginApp

src

resources

eng

LoginAction.properties

In struts.xml, I have put
<constant name="struts.custom.i18n.resources" value="resources//eng//LoginAction" />

Since "src" is the current location,control can go into resources->eng->and access "LoginAction.properties" file.

I would like to put resources\eng\LoginProperties.file outside the src folder

i.e

LoginApp

resource\eng\LoginProperties.file
src


how i can specify in struts.xml?

<constant name="struts.custom.i18n.resources" value=".//resources//eng//LoginAction" />
. is current working directory(i.e src folder)

how i can go backward,to src and mention the path in above value attribute?

Regards,
Anand


jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Anand,

You can put your properties file in the web-inf/classes folder. you can make sub folder in the classes folder.
Example if you property file is in web-inf/classes/property then you can mentioned it

like <constant name="struts.custom.i18n.resources" value="property.customproperties" /> and property file would be customproperties.property .

Regards
Jatan
Anand Sivathanu
Ranch Hand

Joined: Jun 25, 2010
Posts: 76
jatan bhavsar wrote:Hi Anand,

You can put your properties file in the web-inf/classes folder. you can make sub folder in the classes folder.
Example if you property file is in web-inf/classes/property then you can mentioned it

like <constant name="struts.custom.i18n.resources" value="property.customproperties" /> and property file would be customproperties.property .

Regards
Jatan


Hi Jatan,

I will try to put the resources inside the classes.And check whether i can able to access the language resources or not.

My question is "I would like to put resources folder in LoginApp(name of the application) rather than put in LoginApp/src folder.
here src is the current working directory.
How I can access file present in LoginApp?i.e one step backward to current working directory.we can move forward from current working directory(correct me if i am wrong)"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: resource bundle location - struts 2