You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kl...@insyscom.fr on 2000/03/14 14:23:17 UTC

Re: Problems with WAR files




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


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



Re: Problems with WAR files

Posted by co...@eng.sun.com.
Hi,

> My comments below:
Some comments to comments:

> >  <Context path="/examples2" docBase="examples2.war"
> >             defaultSessionTimeOut="30" isWARExpanded="false"
> >             isWARValidated="true" isInvokerEnabled="true"
> >             isWorkDirPersistent="false"/>

This syntax is no longer used in tomcat 3.1.
( it was too confusing and most of the semantic doesn't apply to the
current tomcat)

> > 1. Is loading servlets from class files in war achives supported yet?

By default we support that by expanding the archive automatically at
startup. No need to set any option ( or even to add it to server.xml -
it's enough to place the war file in webapps/ with the name "path.war"
where path is the desired url prefix )

For unexpanded war archives:

It worked in tomcat 3.0 - but it wasn't supported ( i.e nobody tested it).
The code still exists ( but not in the main tree ), but I don't think it 
works anymore.

We moved most of the code outside of core waiting for a cleaner design for
this feature. It seems nobody noticed the missing feature, and I don't
think it has a big priority.

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

Both are deprecated and are no longer used in 3.1.

WAR Validation may be added later in the admin tool where it belongs (
i.e. before deploy ).

Costin