aspose file tools*
The moose likes Servlets and the fly likes External Web Application configuration options? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "External Web Application configuration options?" Watch "External Web Application configuration options?" New topic
Author

External Web Application configuration options?

Chris Nappin
Ranch Hand

Joined: Aug 04, 2005
Posts: 36
What's the best way to have application configuration external to my ear file?

We don't want our customers (who are non-technical) to have to unpack our ear file, then war file, edit web.xml settings or nested properties files, then have to pack everything back up again.

We also need a solution that will work on any application server, e.g. ones that don't unpack the ear and war files as well as those that do, clustered and unclustered, any O/S etc.

My first thought is to use an external property file but this has a few problems:
- difficult to use a consistent file location (perhaps relative to the app server's "current directory" might be best?)
- it would limit our application to only having one instance per server instance

JNDI is pretty complex for a non-technical person to configure, especially in App servers that don't have a web-based configuration front end.

And the database is out because the configuration includes what database to connect to!

Anyone have any further ideas?

Thanks,

Chris.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29255
    
140

Chris,
Welcome to JavaRanch!

An external property file is the way to go.

difficult to use a consistent file location (perhaps relative to the app server's "current directory" might be best?)

You can have a property on the server that points to the file. Then just tell the customer where it is. This works if you know the directory exists. If not, you have to tell the customer where to set the path of the property file. Presumably the person deploying the app will be able to set it. Relative paths are another option, although they tend to be muckier. Non-technical people don't like being in the directories anywhere near the EAR.


it would limit our application to only having one instance per server instance

Why?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Chris Nappin
Ranch Hand

Joined: Aug 04, 2005
Posts: 36
Thanks for the reply.

My comment about being limited to one app per server instance is that if we use a solution like a JVM system property or a global JNDI entry for the property file location, then obviously two instances on the same server would end up pointing at the same file.

We're thinking of going with an external property file, whose location and filename is set as a servlet context init parameter. This filename setting is then per-application, but the downside is that editing this setting requires unpacking and re-packaging the ear and war files.

But then I suppose if a customer wanted to set up several instances of our application on the same server then they'd have to edit the context path in the application.xml anyway.

Unless anyone knows of a tool a non-techie could use to alter the context path in an ear file?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: External Web Application configuration options?
 
Similar Threads
Regarding deployment on Websphere App server
resources in multi war or ear application
Deploye Enterprise application in Server
Deploying Jar inside WebSphere5
Diff. Btwn EAR, WAR, & JAR Files????