You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Draucker <ri...@draucker.com> on 2001/05/19 18:24:26 UTC

web.xml layout

Does anyone know if it makes any difference whether I group
servlet contexts with servlet mappings or keep all contexts
together and below them keep all mappings together. 

Assuming the xml file is being processed by SAX, the
callback handling would make this irrelevant I would think.

Thoughts?....

Thanks,
Richard








RE: web.xml layout

Posted by Richard Draucker <ri...@draucker.com>.
Hmm... correct me where I may be wrong, please.  

If the xml doc doesn't conform to the DTD, it is
not 'valid' xml.  But, so long as it is 'well formed' the
parser will accept it just the same.  

The parser may look to the DTD for a parsing structure, but
the callback utilization of SAX (assuming Tomcat uses SAX to
parse web.xml) will negate any need to have a 'valid' --
as opposed to 'well formed' -- xml document. 

And that is the crux of my question.  Does it really
matter whether web.xml is 'valid' or simply 'well formed'? 



On Sat, 19 May 2001, you wrote:
> It matters, and doesn't have to do with SAX vs. DOM, it's because
> of the DTD - check out this bit of the DTD:
> <!ELEMENT web-app (icon?, display-name?, description?, distribut-able?,
> context-param*, filter*, filter-mapping*, listener*, servlet*,
> servlet-mapping*,
> session-config?, mime-mapping*, welcome-file-list?, error-page*,
> taglib*, resource-env-ref*, resource-ref*, security-constraint*,
> login-config?,
> security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>
> 
> This says that the "servlet-mapping" tags must follow all of the "servlet".
> Basically the
> tags must be in the order above.
> 
> - Robert Petersen
> http://www.orangefood.com
> 
> 
> -----Original Message-----
> From: Richard Draucker [mailto:richard@draucker.com]
> Sent: Saturday, May 19, 2001 9:24 AM
> To: tomcat-user@jakarta.apache.org
> Subject: web.xml layout
> 
> 
> Does anyone know if it makes any difference whether I group
> servlet contexts with servlet mappings or keep all contexts
> together and below them keep all mappings together.
> 
> Assuming the xml file is being processed by SAX, the
> callback handling would make this irrelevant I would think.
> 
> Thoughts?....
> 
> Thanks,
> Richard
-- 
Richard Draucker,  richard@protected-data.com
Protected-Data.Com  www.protected-data.com
Remote data support for web developers.









RE: web.xml layout

Posted by Richard Draucker <ri...@draucker.com>.
Great! Thanks for the link, and cudos to Mike Slinn et.al. 
for the good work.


On Sat, 19 May 2001, you wrote:
> FWIW, I think Mike Slinn has put up a web.xml validator (and other
> useful tools/documentation) at
> 
> http://tomcat.mslinn.com/
> 
> 
> On Sat, 19 May 2001, Robert Petersen wrote:
> 
> > It matters, and doesn't have to do with SAX vs. DOM, it's because
> > of the DTD - check out this bit of the DTD:
> > <!ELEMENT web-app (icon?, display-name?, description?, distribut-able?,
> > context-param*, filter*, filter-mapping*, listener*, servlet*,
> > servlet-mapping*,
> > session-config?, mime-mapping*, welcome-file-list?, error-page*,
> > taglib*, resource-env-ref*, resource-ref*, security-constraint*,
> > login-config?,
> > security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>
> >
> > This says that the "servlet-mapping" tags must follow all of the "servlet".
> > Basically the
> > tags must be in the order above.
> >
> > - Robert Petersen
> > http://www.orangefood.com
> >
> >
> > -----Original Message-----
> > From: Richard Draucker [mailto:richard@draucker.com]
> > Sent: Saturday, May 19, 2001 9:24 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: web.xml layout
> >
> >
> > Does anyone know if it makes any difference whether I group
> > servlet contexts with servlet mappings or keep all contexts
> > together and below them keep all mappings together.
> >
> > Assuming the xml file is being processed by SAX, the
> > callback handling would make this irrelevant I would think.
> >
> > Thoughts?....
> >
> > Thanks,
> > Richard
> >
> >
> >
> >
> >
> >
> >
> >
> 
> Milt Epstein
> Research Programmer
> Software/Systems Development Group
> Computing and Communications Services Office (CCSO)
> University of Illinois at Urbana-Champaign (UIUC)
> mepstein@uiuc.edu
-- 
Richard Draucker,  richard@protected-data.com
Protected-Data.Com  www.protected-data.com
Remote data support for web developers.









RE: web.xml layout

Posted by Milt Epstein <me...@uiuc.edu>.
FWIW, I think Mike Slinn has put up a web.xml validator (and other
useful tools/documentation) at

http://tomcat.mslinn.com/


On Sat, 19 May 2001, Robert Petersen wrote:

> It matters, and doesn't have to do with SAX vs. DOM, it's because
> of the DTD - check out this bit of the DTD:
> <!ELEMENT web-app (icon?, display-name?, description?, distribut-able?,
> context-param*, filter*, filter-mapping*, listener*, servlet*,
> servlet-mapping*,
> session-config?, mime-mapping*, welcome-file-list?, error-page*,
> taglib*, resource-env-ref*, resource-ref*, security-constraint*,
> login-config?,
> security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>
>
> This says that the "servlet-mapping" tags must follow all of the "servlet".
> Basically the
> tags must be in the order above.
>
> - Robert Petersen
> http://www.orangefood.com
>
>
> -----Original Message-----
> From: Richard Draucker [mailto:richard@draucker.com]
> Sent: Saturday, May 19, 2001 9:24 AM
> To: tomcat-user@jakarta.apache.org
> Subject: web.xml layout
>
>
> Does anyone know if it makes any difference whether I group
> servlet contexts with servlet mappings or keep all contexts
> together and below them keep all mappings together.
>
> Assuming the xml file is being processed by SAX, the
> callback handling would make this irrelevant I would think.
>
> Thoughts?....
>
> Thanks,
> Richard
>
>
>
>
>
>
>
>

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu


RE: web.xml layout

Posted by Robert Petersen <ro...@orangefood.com>.
It matters, and doesn't have to do with SAX vs. DOM, it's because
of the DTD - check out this bit of the DTD:
<!ELEMENT web-app (icon?, display-name?, description?, distribut-able?,
context-param*, filter*, filter-mapping*, listener*, servlet*,
servlet-mapping*,
session-config?, mime-mapping*, welcome-file-list?, error-page*,
taglib*, resource-env-ref*, resource-ref*, security-constraint*,
login-config?,
security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

This says that the "servlet-mapping" tags must follow all of the "servlet".
Basically the
tags must be in the order above.

- Robert Petersen
http://www.orangefood.com


-----Original Message-----
From: Richard Draucker [mailto:richard@draucker.com]
Sent: Saturday, May 19, 2001 9:24 AM
To: tomcat-user@jakarta.apache.org
Subject: web.xml layout


Does anyone know if it makes any difference whether I group
servlet contexts with servlet mappings or keep all contexts
together and below them keep all mappings together.

Assuming the xml file is being processed by SAX, the
callback handling would make this irrelevant I would think.

Thoughts?....

Thanks,
Richard









RE: web.xml layout

Posted by CPC Livelink Admin <cp...@fitzpatrick.cc>.
I believe that the web.xml is parsed using the DTD, so rearranging the
elements will make it complain that the format of the file is incorrect.
Even if you find a container which lets you rearrange, the spec says you
should follow the DTD. So to be portable . . . .

Regards,
Paul


-----Original Message-----
From: Richard Draucker [mailto:richard@draucker.com]
Sent: Saturday, May 19, 2001 12:24 PM
To: tomcat-user@jakarta.apache.org
Subject: web.xml layout


Does anyone know if it makes any difference whether I group
servlet contexts with servlet mappings or keep all contexts
together and below them keep all mappings together.

Assuming the xml file is being processed by SAX, the
callback handling would make this irrelevant I would think.

Thoughts?....

Thanks,
Richard