You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ch...@dingoblue.com.au on 2002/04/04 10:19:54 UTC

Problem with Struts and 2.3 Filters

Content-Transfer-Encoding: 7bit

Hi folks,

I am currently endeavouring to add Servlet 2.3 filtering (SiteMesh 1.3,
in fact) to a Struts 1.0.2 application - but having no luck. I have
searched the mailing list archives and can find no reference to this
combination.

I have set up inside one webapp folder of Tomcat 4.0.3 a Struts
application which works correctly if it has the Struts application
web.xml file in WEB-INF.

Then I have copied into that same webapp directory a SiteMesh
application. This also works correctly if it has the SiteMesh
application web.xml file in WEB-INF (moving the Struts web.xml aside for
now).

However, if I add the SiteMesh elements (<filter> and <filter-mapping>
plus some taglibs) to the web.xml of the Struts application it fails.

In catalina.out I get:
---
Starting service Tomcat-Standalone
Apache Tomcat/4.0.3
PARSE error at line 111 column 11
org.xml.sax.SAXParseException: The content of element type "web-app" 
must match "(icon?,display-
name?,description?,distributable?,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*)".
Starting service Tomcat-Apache
Apache Tomcat/4.0.3
---

and the aplication does not work (file not found errors in the browser).

Line 111, column 11 is the very end of the file. I have run Tidy over
web.xml to check for any XML errors and there are none according to that
tool. 

If I comment out the SiteMesh elements and restart Tomcat then the
Struts application starts working again.

If I comment out the Struts elements and restart Tomcat then the
SiteMesh application starts working again.

Can anyone enlighten me as to why the XML parser thinks there is a
problem? I have searched the web for published examples of web.xml that
include filter and servlet definitions and they appear no different in
spirit to what I have...

Any help is much appreciated!

Thanks,

Chris


*********************************************************************
This email and any files transmitted with it may be confidential and
privileged.  It is intended solely for the use of the individual or
parties to whom it is addressed. If you have received this email in
error please forward it to postmaster@dingoblue.com.au and delete all
copies of this message immediately. Thank you.
*********************************************************************


Re: Problem with Struts and 2.3 Filters

Posted by stefan werner <st...@netcologne.de>.
Hello chris,
did you try to place the elements exactly in the order they appear in the
dtd.
You can invoke the error you described f.e. by just crowding elements
together.
sorry about my english, but i hope it helps
cheers
stefan




----- Original Message -----
From: <ch...@dingoblue.com.au>
To: <st...@jakarta.apache.org>
Sent: Thursday, April 04, 2002 10:19 AM
Subject: Problem with Struts and 2.3 Filters


> Content-Transfer-Encoding: 7bit
>
> Hi folks,
>
> I am currently endeavouring to add Servlet 2.3 filtering (SiteMesh 1.3,
> in fact) to a Struts 1.0.2 application - but having no luck. I have
> searched the mailing list archives and can find no reference to this
> combination.
>
> I have set up inside one webapp folder of Tomcat 4.0.3 a Struts
> application which works correctly if it has the Struts application
> web.xml file in WEB-INF.
>
> Then I have copied into that same webapp directory a SiteMesh
> application. This also works correctly if it has the SiteMesh
> application web.xml file in WEB-INF (moving the Struts web.xml aside for
> now).
>
> However, if I add the SiteMesh elements (<filter> and <filter-mapping>
> plus some taglibs) to the web.xml of the Struts application it fails.
>
> In catalina.out I get:
> ---
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0.3
> PARSE error at line 111 column 11
> org.xml.sax.SAXParseException: The content of element type "web-app"
> must match "(icon?,display-
> name?,description?,distributable?,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*)".
> Starting service Tomcat-Apache
> Apache Tomcat/4.0.3
> ---
>
> and the aplication does not work (file not found errors in the browser).
>
> Line 111, column 11 is the very end of the file. I have run Tidy over
> web.xml to check for any XML errors and there are none according to that
> tool.
>
> If I comment out the SiteMesh elements and restart Tomcat then the
> Struts application starts working again.
>
> If I comment out the Struts elements and restart Tomcat then the
> SiteMesh application starts working again.
>
> Can anyone enlighten me as to why the XML parser thinks there is a
> problem? I have searched the web for published examples of web.xml that
> include filter and servlet definitions and they appear no different in
> spirit to what I have...
>
> Any help is much appreciated!
>
> Thanks,
>
> Chris
>
>
> *********************************************************************
> This email and any files transmitted with it may be confidential and
> privileged.  It is intended solely for the use of the individual or
> parties to whom it is addressed. If you have received this email in
> error please forward it to postmaster@dingoblue.com.au and delete all
> copies of this message immediately. Thank you.
> *********************************************************************
>
>


----------------------------------------------------------------------------
----


> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>