tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Limits on the size of the web.xml file?
Date Tue, 04 Sep 2001 03:10:59 GMT


On Mon, 3 Sep 2001, Calvin Lau wrote:

> Date: Mon, 03 Sep 2001 14:23:19 -0700
> From: Calvin Lau <alienx@uclink4.berkeley.edu>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: Re: Limits on the size of the web.xml file?
>
> My web.xml file worked fine in Tomcat3.2.1 as did the <Context>....</Context>
that
> I added to server.xml.  Are there differences in the DTD I'm not aware of?
>

There are two differences that may or may not be relevant to a particular
web app:

* Tomcat 4 does a *validating* XML parse of the web.xml file, so it will
  choke on things like elements not being in the order required by the
  DTD.  (Normally, though, you get a more intelligible error message than
  this one.  Tomcat 3.x did *not* do a validating parse, so the XML
  checking was not as rigorous.

* Tomcat 4 uses JAXP/1.1 to parse web.xml files, where Tomcat 3.2 uses
  JAXP/1.0.  There might have been changes in what the underlying parsers
  accept.

The web.xml DTD for Servlet 2.3 is a proper superset of the DTD for
Servlet 2.2.  In addition, a 2.3 container (like Tomcat 4) is required to
accept a valid web.xml file based on the Servlet 2.2 or 2.3 DTDs.  But, it
does have to be valid (in the XML sense) for this portability to be
achieved -- Tomcat 3.x didn't require this, so it accepted some incorrect
web.xml files.

Craig



> Calvin
>
> "Craig R. McClanahan" wrote:
>
> > On Mon, 3 Sep 2001, Roland wrote:
> >
> > > Date: Mon, 3 Sep 2001 16:37:17 -0300
> > > From: Roland <roland@netquant.com.br>
> > > Reply-To: tomcat-user@jakarta.apache.org
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Re: Limits on the size of the web.xml file?
> > >
> > > > The details *vastly* depend on how your app is put together, but it isn't
> > > > all that complicated to figure out.
> > > >
> > > > Consider that you might have the mailboxes for a particular user defined
> > > > in a database table called "mailboxes", with columns "username" and
> > > > "mailboxname".  It would be easy to construct an SQL statement like this:
> > > >
> > > >   select mailboxname from mailboxes
> > > >     where username = xxx
> > >
> > > Ok, having Data in the database is fine. But what if we also have image
> > > data? We will store Charts and things like that. I think it would be easier
> > > to create a directory for each user(maybe I'm wrong). It is possible to
> > > store images in a mysql database but I think its not as easy as text data.
> > > And then we will have to create a HTML page from that image data and send it
> > > to the user.
> >
> > Storing binary data in the database isn't all that hard.  Then, all you'd
> > need to do is create a servlet mapped to "*.gif", "*.jpg", and so on that
> > did the user identity check before serving the contents (in binary).  The
> > same basic principle would work for data stored in per-user directories.
> > In essence, you're replacing the default file-serving servlet that comes
> > with Tomcat.
> >
> > If you run under Tomcat 4 (which supports Servlet 2.3), you also have
> > another choice -- you can implement your custom authentication checker as
> > a Filter instead of a Servlet.  That way, you can apply your own custom
> > check onto any path, without having to modify or replace the file-serving
> > servlet that comes with Tomcat.
> >
> > Craig
>
>



Mime
View raw message