You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lukasz Kucharski <lk...@gmail.com> on 2005/06/05 17:24:47 UTC

Managing config files rules of thumb?

Hi

I'm new to Tapestry, I've managed to implement two working
applications so far. My question in not closely related to Tapestry
itself but since this mailing list is so helpful and active I decided
to ask.

I noticed that since I started using Hibernate, Springs IoC containter
and other frameworks there is so many xml config files to manage.
First thing you have to place them somwhere then you have to find them
somehow in your application context.

My question is what is the best way to prevent hardcoding paths to
config files in your application code, to make it somehow configurable
but on the other hand to not introduce another config files for config
files ;)

I use Tomcat servlet containter and I must say I am little confused.
Take Hibernate for instance. There is this hibernate config file, then
hibernate mapping file which I have to place in
C:/windows/system32 dir to be seen by hibernate. I tried to use
absolute paths etc. but that does not seem to work. It's as if
hibernate behaves different in a web application and different in
desktop application.  Everything is a mess right now and I would
really appreciate if any experienced userd could give me a clues how
to cope with this problem. I just need general directions how to
manage those configs.

I thought about definig paths to config files in web.xml as an
application context parameters and then get them in my web app but is
this any good?



-- 
Best
Pozdrawiam

Lukasz Kucharski
lkucharsNOSPAM@gmail.com
lkucharsNOSPAM@students.depaul.edu

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


Re: Managing config files rules of thumb?

Posted by Matt Lyons <ml...@internode.com.au>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Have a look at maven (http://maven.apache.org)

Not sure how well it runs on windows though.

- --
Matt Lyons (B.CS & SE)
Analyst Programmer, Internode Systems
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCo7PCLuMxjpa11VERAtG7AJ9GBOBeI0La3+asNbY0H/Aq9An9IACdHD0i
cOnGcl6oiZnpRjYemO6ylwQ=
=uOlV
-----END PGP SIGNATURE-----

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


Re: Managing config files rules of thumb?

Posted by Pablo Ruggia <pr...@gmail.com>.
On 6/5/05, Lukasz Kucharski <lk...@gmail.com> wrote:
> Hi
> 
> I'm new to Tapestry, I've managed to implement two working
> applications so far. My question in not closely related to Tapestry
> itself but since this mailing list is so helpful and active I decided
> to ask.
> 
> I noticed that since I started using Hibernate, Springs IoC containter
> and other frameworks there is so many xml config files to manage.
> First thing you have to place them somwhere then you have to find them
> somehow in your application context.
> 
> My question is what is the best way to prevent hardcoding paths to
> config files in your application code, to make it somehow configurable
> but on the other hand to not introduce another config files for config
> files ;)
> 
> I use Tomcat servlet containter and I must say I am little confused.
> Take Hibernate for instance. There is this hibernate config file, then
> hibernate mapping file which I have to place in
> C:/windows/system32 dir to be seen by hibernate. 

Mmm,  I don't think so. You can put mapping files everywhere in your
classpath, and definitivly it's not a good idea to put your mapping
files in that directory.

I tried to use
> absolute paths etc. but that does not seem to work. It's as if
> hibernate behaves different in a web application and different in
> desktop application.  Everything is a mess right now and I would
> really appreciate if any experienced userd could give me a clues how
> to cope with this problem. I just need general directions how to
> manage those configs.
> 
> I thought about definig paths to config files in web.xml as an
> application context parameters and then get them in my web app but is
> this any good?

Of course it's good.

If you use Spring, you can specify in web.xml where to find your
context files as a servlet parameter. And you can use some of these
context files to specify where are the mappings files.


> 
> 
> 
> --
> Best
> Pozdrawiam
> 
> Lukasz Kucharski
> lkucharsNOSPAM@gmail.com
> lkucharsNOSPAM@students.depaul.edu
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

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