The Artima Developer Community
Sponsored Link

Java Buzz Forum
WAR files : to explode or not?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Simon Brown

Posts: 636
Nickname: simonbrown
Registered: Jun, 2003

Simon Brown is a Java developer, architect and author.
WAR files : to explode or not? Posted: Feb 13, 2007 2:46 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Simon Brown.
Original Post: WAR files : to explode or not?
Feed Title: Simon Brown's weblog
Feed URL: http://www.simongbrown.com/blog/feed.xml?flavor=rss20&category=java
Feed Description: My thoughts on Java, software development and technology.
Latest Java Buzz Posts
Latest Java Buzz Posts by Simon Brown
Latest Posts From Simon Brown's weblog

Advertisement

In Stop the pollution in WEB-INF/classes, Sebastiano talks about the proliferation of configuration files underneath the /WEB-INF/classes directory of Java EE web applications. It's an interesting post and I like the recommendation of placing configuration files in a separate directory. However, it was the first comment that sparked me to write this blog entry.

WAR files are used a lot, in my experience, far more than exploded directories.

Personally, I'm starting to use WAR files for deployment much less than I ever used to, and this is exactly because of the reasons outlined in Sebastiano's blog entry. Now, I prefer to keep the exploded web application directory structure outside of the web container installation and simply link to it instead (e.g. using a separate Tomcat context definition). Problems with throwing a single deployable unit at a web container installation include...

  • Configuration can't be tweaked if needed (e.g. log levels).
  • Application patches are harder to apply.
  • Web container upgrades are more complex.

There's also something more fundamental. Back in the good old days of J2EE, it was quite common to see configuration defined at the application/web server level, utilising JNDI for example. Now, frameworks are pushing configuration back into the web application because it does make for applications that are easier to port between containers. You just have to take a look at Spring and Acegi for examples of how database and security configuration can now reside alongside the webapp, in a container independent way.

This has some interesting consequences, particularly if you need to hand-off a web application to a separate team for deployment into production. Typically, development doesn't have access to the production configuration (e.g. database credentials) so providing an exploded webapp tends to make installation/deployment/customisation an easier process, regardless of whether it's manual or automated.

I'm curious, what's your preference - a WAR file or its exploded form?

Read: WAR files : to explode or not?

Topic: Nigel Wetters Gourlay has released JavaInetLocator 2.23, a library based on Whois information... Previous Topic   Next Topic Topic: Ohad Serfaty has released the Java Mozilla Html Parser 0.1.2,

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use