• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ApplicationResource. properties file ?

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Artemesia Lakener
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ?
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks. Actually I have found the answer to this question too. Later on I posted another question

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

If you can help on that, I will appreciate it.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic