tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harish Prabandham <Harish.Praband...@eng.sun.com>
Subject Re: Problems with WAR files
Date Wed, 08 Dec 1999 19:33:05 GMT
Hi,

My comments below:

Jonathan Pierce wrote:

> All,
>
> Is the war file support complete yet in the current build?
>
> I just tried to jar up the examples folder into a war file called examples2.war
> and added an entry to my server.xml file as shown below:
>
>  <Context path="/examples2" docBase="examples2.war"
>             defaultSessionTimeOut="30" isWARExpanded="false"
>             isWARValidated="true" isInvokerEnabled="true"
>             isWorkDirPersistent="false"/>
>
> I was able to access the HelloWorld Example source with:
> http://localhost:8080/examples2/servlets/helloworld.html
>
> I was not able to run the example though as I received an HTML 404 page not
> found error when I tried the URL:
> http://localhost:8080/examples2/servlets/helloworld.html
>
> Questions that I have are:
>
> 1. Is loading servlets from class files in war achives supported yet?

There are some very interesting issues running everything out of a war
file. Before we get into the details of it, I would like to mention that the
servlet 2.2 spec does not *require* you to run out of a war file.
war file is a format for archiving a web application - thats it.  Unlike a
jar file it may also contain static-files/content - not just code.

When you run stuff of a war file, you may be able to serve static content
but you will run into problem when compiling JSP files. Why? because
when the JSPs refer to classes in classes or lib directory, javac cannot
compile (or refer) to them.

When you are in development mode (thats what real web sites are
pretty much all the time), it is even a bigger pain because you would need
to package the new content into the jar & the server needs to reload it.
This is a bit un-natural for web programmers currently.

But, war files are a great way to distribute web applications. At some
point in time, the admin utility should be able to take a war file and
start a context.


>
> 2. Is loading servlets from jar files in the lib directory in war achives
> supported yet?

Yes.

>
> 3. Can you explain the meaning of the isWARValidated and isWARExpanded tags?

IsWarValidated, turns on the validating parser. isWarExpanded is a flag that
tells the server whether to expand the war file or not.

I agree the names are bad. They should be called:

shouldUseValidatingParser and shouldExpandWar respectively.

>
>
> Thanks,
>
> Jonathan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org

Thanx



Harish


Mime
View raw message