You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeff Larsen <la...@qec.com> on 2002/03/20 18:01:05 UTC

Tab Characters in web.xml (Tomcat 4.0.3)

I've been developing a web application in JBuilder using Tomcat 3.2
with great success. Now it's time for the real world. I'm deploying
my app on Tomcat 4.0.3 on Solaris and I'm having problems with my
web.xml. When Tomcat starts, it gives me the following error:

2002-03-20 10:47:48 ContextConfig[/online] Parse error in application web.xml
org.xml.sax.SAXParseException: The content of element type "web-app" must match
"(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*
,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,securi
ty-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".

OK, so it's just validating my web.xml against the DTD. BUT... my web.xml
is correct. If I remove the leading tab characters from the lines of
web.xml and replace them with plain spaces, it parses just fine.

What gives?!?!?  Since when are tabs not legal whitespace?!?!?!

Jeff


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Tab Characters in web.xml (Tomcat 4.0.3)

Posted by Emir Alikadic <ea...@sympatico.ca>.
On 3/20/2002 12:01 PM, Jeff Larsen wrote:
> I've been developing a web application in JBuilder using Tomcat 3.2
> with great success. Now it's time for the real world. I'm deploying
> my app on Tomcat 4.0.3 on Solaris and I'm having problems with my
> web.xml. When Tomcat starts, it gives me the following error:
> 
> 2002-03-20 10:47:48 ContextConfig[/online] Parse error in application web.xml
> org.xml.sax.SAXParseException: The content of element type "web-app" must match
> "(icon?,display-name?,description?,distributable?,context-param*,servlet*,servlet-mapping*
> ,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,securi
> ty-constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> 
> OK, so it's just validating my web.xml against the DTD. BUT... my web.xml
> is correct. If I remove the leading tab characters from the lines of
> web.xml and replace them with plain spaces, it parses just fine.
> 
> What gives?!?!?  Since when are tabs not legal whitespace?!?!?!
> 
> Jeff

Not sure if tabs are the culprit, but I'd suspect element order problem.  Just 
rearrange the elements according to the list provided and you should be good to go.

Tabs should be avoided for indentation, especially in XML files, with all the 
nesting.  Open up an XML file with 4 or 5 *tabbed* level nesting in an 80x25 
UNIX console if you don't believe me.  Set your editor to replace tab character 
with spaces and don't forget the soft/hard right margin at 80.


Emir.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>