Mikolaj Rydzewski wrote:
Ingo Siebert wrote:
I have to find a good solution for the configuration of my web
application.
Right now, i have a configuration file in my WAR.
But I think it's not the best solution, because
- I can't the change the config before deployment
- a redeployment of a new WAR replaces my changes
I'd use JNDI to store either configuration data itself, or a pointer to
such data (e.g. full path to filename with configuration data). You
configure it at container level, so it's portable, it doesn't interfere
with other webapps, and works.
This is what I prefer, too.
Then the interface between container and application will be
documented as:
The application requires data element XXX in container JNDI context,
in order to locate YYY.
This way (when taken to completion) it becomes possible to deploy exact same
.war
file into test and production. Things within the .war are only allowed to access
other things within the .war and elements residing in the JNDI context (and
transitively, things referred to by the JNDI context elements).
The webapp specifically should not have persistent knowledge/assumption of:
- the name of the server on which it is located
(can be obtained dynamically at runtime)
- the name of a frontend proxy through which it is accessed
(provided by configuration IF needed)
- filesystem path to which the application is deployed
(not needed; see also the next one)
- any filesystem data on the server
(resources within the .war shouldn't be accessed by the filesystem
APIs, either; instead the resource retrieval functionality of
servlet API should be used -- this also because it is not guaranteed
that the webapp is expanded into any directory structure)
- access details of any database or other external service used by
the webapp
(provided by configuration)
However, the "configuration" external to the webapp should not contain
anything that is considered specific to a given version of the application.
The external configuration should only contain the necessary declarations
of the runtime environment provided to the webapp.
--
..Juha
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]