File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How To Access struts Properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How To Access struts Properties file " Watch "How To Access struts Properties file " New topic
Author

How To Access struts Properties file

Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
Hi Friends, am new to struts.I read that " you can store variables in xml file(properties file) and for future enhancements we just call properties file . Now i want to implement this , where can i call properties file to enhance my application. My question is where this properties file will be called.
Jer Deras
Greenhorn

Joined: Sep 29, 2009
Posts: 10
specify in the build.xml file

<!-- Normal build of application -->
<target name="compile" depends="prepare,resources">
<javac srcdir="src" destdir="${webinf.dir}/classes">
<classpath refid="compile.classpath"/>
</javac>
<copy file="src/struts.xml" todir="${webinf.dir}/classes"/>
<copy file="src/struts.properties" todir="${webinf.dir}/classes"/>
<copy file="src/jbpm.cfg.xml" todir="${webinf.dir}/classes"/>
<copy file="src/jbpm.hibernate.cfg.xml" todir="${webinf.dir}/classes"/>
</target>

and have your struts.properties file in source folder
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

@Rajendra: what types of properties are you going to use? Which version of Struts?
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
Hi Friends, I read in the net "we can use properties file for future enhancements. for example you can change your application from english to some other language " . I have no idea , what is actually stored in properties file. can you tell me for struts 2.0 Version . Also please tell file extension of properties file. Explain complete details about properties file.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Have you searched the web? Properties files end in ".properties". This is standard Java I18N. For Struts 2-specific information see here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To Access struts Properties file