Hi,
I am creating a struts web app. ApplicationResources.properties is supposed to hold some application specific constants for the web app. How and where do parse (if that's right word) ApplicationResources.properties file in order to extract those constants in put them in application scope.
Or more basic question: how do I use ApplicationResources.properties file to store application constants/properties and how can I make use of it.
Thanks,
P.I.
-
Struts ApplicationResources.properties (4 messages)
- Posted by: P I
- Posted on: April 27 2005 17:00 EDT
Threaded Messages (4)
- Struts ApplicationResources.properties by vivek malhotra on April 28 2005 01:55 EDT
- Struts ApplicationResources.properties by P I on April 28 2005 08:58 EDT
- Struts ApplicationResources.properties by Paul Morie on April 28 2005 02:11 EDT
- Re: Struts ApplicationResources.properties by sreejith p on November 20 2006 05:20 EST
- Struts ApplicationResources.properties by P I on April 28 2005 08:58 EDT
-
Struts ApplicationResources.properties[ Go to top ]
- Posted by: vivek malhotra
- Posted on: April 28 2005 01:55 EDT
- in response to P I
Hi!
You donot need to do anything yourself. Just mention it in your strut-config.xml as:
<message-resources parameter="ApplicationResources"/>
Now whenever in your JSP, you like to use it just use bean:message and give the key against which you have stored your string or message that you have stored in the properties file -
Struts ApplicationResources.properties[ Go to top ]
- Posted by: P I
- Posted on: April 28 2005 08:58 EDT
- in response to vivek malhotra
How can I use JSP if I want to extract these variables to form Application configuration - so that java beans and DAOs can use them. should my first JSP (may be loging.jsp) do the extraction and form the app. configuration?
Thanks,
P.I. -
Struts ApplicationResources.properties[ Go to top ]
- Posted by: Paul Morie
- Posted on: April 28 2005 14:11 EDT
- in response to P I
Hi P.I.-
Do you mean that you want to use the configuration information outside of the control layer? It seems like one option would be to pass them directly to the model layer in your action classes, where the information should be available in the ServletContext.
In terms of where they should be initialized, it seems like the init() method of your ActionServlet would be an appropriate place.
HTH
P -
Re: Struts ApplicationResources.properties[ Go to top ]
- Posted by: sreejith p
- Posted on: November 20 2006 05:20 EST
- in response to vivek malhotra
Hi!
hello sir, i went through your post, but as u said, i am not getting the details using the applicationresources.properties file. i am using eclipse 3.1 with myeclipse, the data is being shown in the preview but not in the browser when i am running my project awaiting your reply. sreejith
You donot need to do anything yourself. Just mention it in your strut-config.xml as:
Now whenever in your JSP, you like to use it just use bean:message and give the key against which you have stored your string or message that you have stored in the properties file