aspose file tools*
The moose likes Struts and the fly likes ApplicationResource. properties file ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ApplicationResource. properties file ?" Watch "ApplicationResource. properties file ?" New topic
Author

ApplicationResource. properties file ?

Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
In Jdeveloper IDE it automatically creates a "ApplicationResource.properties". But in some tutorial it doesn't require it. I want to know --

1. I use struts 1.2.4, is this file a required one ? in some book I saw it is called "Application.properties". Really confused. what should be the correct name for 1.2.4 ? and more importantly, WHERE should it be put ? is it in WEB-INF/ along with web.xml ?

2. any URL site describing this and gice examples ?

Thanks.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Name it whatever you want, just be sure to have the same name in your struts-config:
<message-resources parameter="mypackage.ApplicationResources"/>
Notice that the package name is part of the name here (the .properties is left off only in the tag, the real file has it), so the file should be placed in the src folder with your Java code.

I don't think it is required.


A good workman is known by his tools.
Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
Originally posted by Marc Peabody:
Name it whatever you want, just be sure to have the same name in your struts-config:
<message-resources parameter="mypackage.ApplicationResources"/>
Notice that the package name is part of the name here (the .properties is left off only in the tag, the real file has it), so the file should be placed in the src folder with your Java code.

I don't think it is required.



thanks. so the file you specified is supposed to be at WEB-INF/classes/mypackage/ and it is ApplicationResource.properties
Am I right ?
Ajay Reddy
Ranch Hand

Joined: Apr 08, 2005
Posts: 43
Try this URL -- http://www.reumann.net/struts/lesson1.do

It is upto you what you want to call the file. This file name has to be specified in web.xml. I believe the extension has to be .properties for struts to recognize this as a resource file.
Ajay Reddy
Ranch Hand

Joined: Apr 08, 2005
Posts: 43
Clarification on where the resource file is specified. If you use
struts-config_1_2.dtd then the resource file must be specified in struts-config.xml but prior to that it could be specified either in web.xml or struts-config.xml.

Hope this clarifies a little bit.

Here is how I have in struts-config.xml, I use struts-config_1_2.dtd ---

<!-- message resources -->
<message-resources parameter="com.ApplicationResources" null="false" />

The ApplicationResources.properties file is under 'com' directory.
Artemesia Lakener
Ranch Hand

Joined: Jun 21, 2005
Posts: 162
thanks. Actually I have found the answer to this question too. Later on I posted another question

http://www.coderanch.com/t/51504/Struts/display-error-msg-matching-key

If you can help on that, I will appreciate it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ApplicationResource. properties file ?