You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Simone - Dev <si...@piyosailing.com> on 2005/04/17 20:19:33 UTC

Best practice for storing configuration data

Today I run into an dubt:
is the way I always used to store application dependent configuration is
correct?
 
I use to store this kind of information in the we.xml file using
<context-param> like this one
 
 <context-param>
  <param-name>uploadedFilePath</param-name> 
 
<param-value>D:/Documenti/Progetti/jClubHouse/build/uploadedFiles/</para
m-value> 
  <description>The path to save the uploadedFiles to</description> 
 </context-param>
 
and then inside actions, I retrieve it using
 
String
uploadDir=getServlet().getServletContext().getInitParameter("uploadedFil
ePath");
 
 
is there a better practice or is this the right one?
 
Simone
 
-------------------------
Simone Chiaretta
 <http://www.piyosailing.com/S> www.piyosailing.com/S
Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

 <http://www.spreadfirefox.com/?q=affiliates&id=2476&t=81> Get Firefox!
 

Re: Best practice for storing configuration data

Posted by Simone-dev <si...@piyosailing.com>.
Great,
I like the idea of storing data inside the server.xml or using the admin 
tool...
using the <Environment> tag... if you have access to the adminstration 
of the server

unfortunately this doesn't work if you just have access to you context 
directory...
 From what I read on all the thread
http://marc.theaimsgroup.com/?t=111176874200007&r=1&w=2 
<http://marc.theaimsgroup.com/?t=111176874200007&r=1&w=2>

the only possibile solution is saving application data in the web.xml

simone

Erik Weber wrote:

> Related:
>
> http://www.mail-archive.com/user@struts.apache.org/msg24083.html
>
>
> Erik
>
>
>
> Simone - Dev wrote:
>
>> Today I run into an dubt:
>> is the way I always used to store application dependent configuration 
>> is correct?
>>  
>> I use to store this kind of information in the we.xml file using 
>> <context-param> like this one
>>  
>>  <context-param>
>>   <param-name>uploadedFilePath</param-name>
>>   
>> <param-value>D:/Documenti/Progetti/jClubHouse/build/uploadedFiles/</param-value> 
>>
>>   <description>The path to save the uploadedFiles to</description>
>>  </context-param>
>>  
>> and then inside actions, I retrieve it using
>>  
>> String 
>> uploadDir=getServlet().getServletContext().getInitParameter("uploadedFilePath"); 
>>
>>  
>>  
>> is there a better practice or is this the right one?
>>  
>> Simone
>>  
>> -------------------------
>> Simone Chiaretta
>> www.piyosailing.com/S <http://www.piyosailing.com/S>
>> /Any sufficiently advanced technology is indistinguishable from magic/
>> /"Life is short, play hard"/
>>
>> <http://www.spreadfirefox.com/?q=affiliates&id=2476&t=81>
>>  
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Best practice for storing configuration data

Posted by Erik Weber <er...@mindspring.com>.
Related:

http://www.mail-archive.com/user@struts.apache.org/msg24083.html


Erik



Simone - Dev wrote:

> Today I run into an dubt:
> is the way I always used to store application dependent configuration 
> is correct?
>  
> I use to store this kind of information in the we.xml file using 
> <context-param> like this one
>  
>  <context-param>
>   <param-name>uploadedFilePath</param-name>
>   <param-value>D:/Documenti/Progetti/jClubHouse/build/uploadedFiles/</param-value> 
>
>   <description>The path to save the uploadedFiles to</description>
>  </context-param>
>  
> and then inside actions, I retrieve it using
>  
> String 
> uploadDir=getServlet().getServletContext().getInitParameter("uploadedFilePath");
>  
>  
> is there a better practice or is this the right one?
>  
> Simone
>  
> -------------------------
> Simone Chiaretta
> www.piyosailing.com/S <http://www.piyosailing.com/S>
> /Any sufficiently advanced technology is indistinguishable from magic/
> /"Life is short, play hard"/
>
> <http://www.spreadfirefox.com/?q=affiliates&id=2476&t=81>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org