cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Patrick Scheuerer
Hi,

I cannot get Filters to work with Tomcat 5.0.16.

Here are my filter definitions in web.xml:
filter
filter-nameUserFilter/filter-name
filter-classch.ctc.support.common.UserFilter/filter-class
/filter
filter
filter-nameAdminFilter/filter-name
filter-classch.ctc.support.common.AdminFilter/filter-class
/filter
filter-mapping
filter-nameUserFilter/filter-name
servlet-name/*/servlet-name
/filter-mapping
filter-mapping
filter-nameAdminFilter/filter-name
url-pattern/admin/*/url-pattern
/filter-mapping
Every time Tomcat tries to start the context I get the following exception:

java.lang.IllegalArgumentException: Filter mapping must specify either a 
url-pattern or a servlet-name
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at 
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:302)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:644)
at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:254)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4212)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at 
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:316)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:859)
at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:723)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:393)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)

What the hell is going on here? I DID specify a url-pattern!  What am I doing 
wrong? Any help would be highly appreciated!

Thanks,
Patrick


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Shapira, Yoav

Howdy,
Your first filter-mapping is mapping to a servlet-name /*?? ;)  Either
put a defined servlet name there or map to url-pattern /*.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Patrick Scheuerer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 06, 2004 10:29 AM
To: Tomcat Users List
Subject: cannot get Filters to work with Tomcat 5.0.16

Hi,

I cannot get Filters to work with Tomcat 5.0.16.

Here are my filter definitions in web.xml:
filter
 filter-nameUserFilter/filter-name
 filter-classch.ctc.support.common.UserFilter/filter-class
/filter

filter
 filter-nameAdminFilter/filter-name
 filter-classch.ctc.support.common.AdminFilter/filter-class
/filter

filter-mapping
 filter-nameUserFilter/filter-name
 servlet-name/*/servlet-name
/filter-mapping

filter-mapping
 filter-nameAdminFilter/filter-name
 url-pattern/admin/*/url-pattern
/filter-mapping

Every time Tomcat tries to start the context I get the following
exception:

java.lang.IllegalArgumentException: Filter mapping must specify either
a
url-pattern or a servlet-name
 at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2
540)
 at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2
566)
 at
org.apache.commons.digester.Digester.endElement(Digester.java:1061)
 at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
 at
org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown
Source)
 at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
Source)
 at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Un
know
n Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDi
spat
cher.dispatch(Unknown
Source)
 at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkn
own
Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
 at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
 at org.apache.commons.digester.Digester.parse(Digester.java:1548)
 at
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConf
ig.j
ava:302)
 at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:644)
 at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.
java
:254)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleS
uppo
rt.java:166)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:421
2)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.j
ava:
866)
 at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
 at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
 at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeplo
yer.
java:316)
 at
org.apache.catalina.core.StandardHost.install(StandardHost.java:859)
 at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.jav
a:72
3)
 at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)
 at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1002)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:3
93)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleS
uppo
rt.java:166)
 at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
 at
org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
 at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
 at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
 at
org.apache.catalina.core.StandardService.start(StandardService.java:519
)
 at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2343)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.ja
va:3
9)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso
rImp
l.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)

What the hell is going on here? I DID specify a url-pattern!  What am
I
doing
wrong? Any help would be highly appreciated!

Thanks,
Patrick




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential

Re: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Patrick Scheuerer
Shapira, Yoav wrote:

 Howdy,
 Your first filter-mapping is mapping to a servlet-name /*??   Either
 put a defined servlet name there or map to url-pattern /*.
I'll try copy/paste this time. Here's the filter declaration:

filter
filter-nameUserFilter/filter-name
filter-classch.ctc.support.common.UserFilter/filter-class
/filter
filter
filter-nameAdminFilter/filter-name
filter-classch.ctc.support.common.AdminFilter/filter-class
/filter
filter-mapping
filter-nameUserFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping
filter-mapping
filter-nameAdminFilter/filter-name
url-pattern/admin/*/url-pattern
/filter-mapping
I want every requets to go through the UserFilter and every request to 
/execute/admin/* (it's a Struts app) through the AdminFilter.

I can't see what's wrong.

Patrick



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Shapira, Yoav

Howdy,
Looks good.  Did you try either one of the filters individually to see
if it works by itself?  Do you have any other errors in your logs?
Anything else in web.xml?

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Patrick Scheuerer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 06, 2004 10:52 AM
To: Tomcat Users List
Subject: Re: cannot get Filters to work with Tomcat 5.0.16

Shapira, Yoav wrote:

  Howdy,
  Your first filter-mapping is mapping to a servlet-name /*??   Either
  put a defined servlet name there or map to url-pattern /*.


I'll try copy/paste this time. Here's the filter declaration:

filter
 filter-nameUserFilter/filter-name
 filter-classch.ctc.support.common.UserFilter/filter-class
/filter

filter
 filter-nameAdminFilter/filter-name
 filter-classch.ctc.support.common.AdminFilter/filter-class
/filter

filter-mapping
 filter-nameUserFilter/filter-name
 url-pattern/*/url-pattern
/filter-mapping

filter-mapping
 filter-nameAdminFilter/filter-name
 url-pattern/admin/*/url-pattern
/filter-mapping

I want every requets to go through the UserFilter and every request to
/execute/admin/* (it's a Struts app) through the AdminFilter.

I can't see what's wrong.

Patrick



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Patrick Scheuerer
Shapira, Yoav wrote:

Howdy,
Looks good.  Did you try either one of the filters individually to see
if it works by itself?  Do you have any other errors in your logs?
Anything else in web.xml?
I tried both filters individually. Same thing. If i delete the filter stuff, 
everything works like a charm. as soon as I put it back in the exception is 
thrown again. It's one of those metaphysical problems that drive you up the 
walls :-( grr

Just to make sure there's no other problem I'm inluding my complete web.xml file:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
 filter
  filter-nameUserFilter/filter-name
  filter-classch.ctc.support.common.UserFilter/filter-class
 /filter
 filter
  filter-nameAdminFilter/filter-name
  filter-classch.ctc.support.common.AdminFilter/filter-class
 /filter
 filter-mapping
  filter-nameUserFilter/filter-name
  url-pattern/*/url-pattern
  servlet-name/
 /filter-mapping
 filter-mapping
  filter-nameAdminFilter/filter-name
  url-pattern/admin/*/url-pattern
  servlet-name/
 /filter-mapping
 servlet
  servlet-nameaction/servlet-name
  servlet-classorg.apache.struts.action.ActionServlet/servlet-class
  init-param
   param-nameconfig/param-name
   param-value/WEB-INF/struts-config.xml/param-value
  /init-param
  init-param
   param-namedebug/param-name
   param-value2/param-value
  /init-param
  init-param
   param-namedetail/param-name
   param-value2/param-value
  /init-param
  init-param
   param-namedataDir/param-name
   param-value/data/param-value
  /init-param
  load-on-startup2/load-on-startup
 /servlet
 servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern/execute/*/url-pattern
 /servlet-mapping
 welcome-file-list
  welcome-filesupport.jsp/welcome-file
 /welcome-file-list
 taglib
  taglib-uri/tags/struts-bean/taglib-uri
  taglib-location/WEB-INF/tlds/struts-bean.tld/taglib-location
 /taglib
 taglib
  taglib-uri/tags/struts-html/taglib-uri
  taglib-location/WEB-INF/tlds/struts-html.tld/taglib-location
 /taglib
 taglib
  taglib-uri/tags/struts-logic/taglib-uri
  taglib-location/WEB-INF/tlds/struts-logic.tld/taglib-location
 /taglib
 taglib
  taglib-uri/tags/struts-nested/taglib-uri
  taglib-location/WEB-INF/tlds/struts-nested.tld/taglib-location
 /taglib
 taglib
  taglib-uri/tags/struts-template/taglib-uri
  taglib-location/WEB-INF/tlds/struts-template.tld/taglib-location
 /taglib
 taglib
  taglib-uri/tags/struts-tiles/taglib-uri
  taglib-location/WEB-INF/tlds/struts-tiles.tld/taglib-location
 /taglib
 taglib
  taglib-uri/tags/struts-bean-el/taglib-uri
  taglib-location/WEB-INF/tlds/struts-bean-el.tld/taglib-location
 /taglib
 taglib
  taglib-uri/tags/struts-html-el/taglib-uri
  taglib-location/WEB-INF/tlds/struts-html-el.tld/taglib-location
 /taglib
 taglib
  taglib-uri/tags/struts-logic-el/taglib-uri
  taglib-location/WEB-INF/tlds/struts-logic-el.tld/taglib-location
 /taglib
 taglib
  taglib-uri/jstl/c/taglib-uri
  taglib-location/WEB-INF/tlds/c.tld/taglib-location
 /taglib
/web-app
Any further ideas anybody?

Thanks!
Patrick


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Shapira, Yoav

Howdy,
OK, now that's the 3rd different version of the filter elements in your
web.xml ;)  You shouldn't have both servlet-name and url-pattern
children of filter-mapping, only one of them.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: Patrick Scheuerer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 06, 2004 11:32 AM
To: Tomcat Users List
Subject: Re: cannot get Filters to work with Tomcat 5.0.16

Shapira, Yoav wrote:

 Howdy,
 Looks good.  Did you try either one of the filters individually to
see
 if it works by itself?  Do you have any other errors in your logs?
 Anything else in web.xml?

I tried both filters individually. Same thing. If i delete the filter
stuff,
everything works like a charm. as soon as I put it back in the
exception is
thrown again. It's one of those metaphysical problems that drive you
up
the
walls :-( grr

Just to make sure there's no other problem I'm inluding my complete
web.xml
file:

?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web
Application
2.3//EN
  http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
  filter
   filter-nameUserFilter/filter-name
   filter-classch.ctc.support.common.UserFilter/filter-class
  /filter
  filter
   filter-nameAdminFilter/filter-name
   filter-classch.ctc.support.common.AdminFilter/filter-class
  /filter
  filter-mapping
   filter-nameUserFilter/filter-name
   url-pattern/*/url-pattern
   servlet-name/
  /filter-mapping
  filter-mapping
   filter-nameAdminFilter/filter-name
   url-pattern/admin/*/url-pattern
   servlet-name/
  /filter-mapping
  servlet
   servlet-nameaction/servlet-name

servlet-classorg.apache.struts.action.ActionServlet/servlet-class
   init-param
param-nameconfig/param-name
param-value/WEB-INF/struts-config.xml/param-value
   /init-param
   init-param
param-namedebug/param-name
param-value2/param-value
   /init-param
   init-param
param-namedetail/param-name
param-value2/param-value
   /init-param
   init-param
param-namedataDir/param-name
param-value/data/param-value
   /init-param
   load-on-startup2/load-on-startup
  /servlet
  servlet-mapping
   servlet-nameaction/servlet-name
   url-pattern/execute/*/url-pattern
  /servlet-mapping
  welcome-file-list
   welcome-filesupport.jsp/welcome-file
  /welcome-file-list
  taglib
   taglib-uri/tags/struts-bean/taglib-uri
   taglib-location/WEB-INF/tlds/struts-bean.tld/taglib-location
  /taglib
  taglib
   taglib-uri/tags/struts-html/taglib-uri
   taglib-location/WEB-INF/tlds/struts-html.tld/taglib-location
  /taglib
  taglib
   taglib-uri/tags/struts-logic/taglib-uri
   taglib-location/WEB-INF/tlds/struts-logic.tld/taglib-location
  /taglib
  taglib
   taglib-uri/tags/struts-nested/taglib-uri
   taglib-location/WEB-INF/tlds/struts-nested.tld/taglib-location
  /taglib
  taglib
   taglib-uri/tags/struts-template/taglib-uri
   taglib-location/WEB-INF/tlds/struts-template.tld/taglib-location
  /taglib
  taglib
   taglib-uri/tags/struts-tiles/taglib-uri
   taglib-location/WEB-INF/tlds/struts-tiles.tld/taglib-location
  /taglib
  taglib
   taglib-uri/tags/struts-bean-el/taglib-uri
   taglib-location/WEB-INF/tlds/struts-bean-el.tld/taglib-location
  /taglib
  taglib
   taglib-uri/tags/struts-html-el/taglib-uri
   taglib-location/WEB-INF/tlds/struts-html-el.tld/taglib-location
  /taglib
  taglib
   taglib-uri/tags/struts-logic-el/taglib-uri
   taglib-location/WEB-INF/tlds/struts-logic-el.tld/taglib-location
  /taglib
  taglib
   taglib-uri/jstl/c/taglib-uri
   taglib-location/WEB-INF/tlds/c.tld/taglib-location
  /taglib
/web-app

Any further ideas anybody?

Thanks!
Patrick



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Ralph Einfeldt
There is an unneeded servlet-name/.

As I understand the error message you have to use
either url-pattern or servlet-name.

(Not shure if this is the problem, as I havn't used filters by now)

 -Original Message-
 From: Patrick Scheuerer [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, January 06, 2004 5:32 PM
 To: Tomcat Users List
 Subject: Re: cannot get Filters to work with Tomcat 5.0.16
 
 
   filter-mapping
filter-nameUserFilter/filter-name
url-pattern/*/url-pattern
servlet-name/
   /filter-mapping
   filter-mapping
filter-nameAdminFilter/filter-name
url-pattern/admin/*/url-pattern
servlet-name/
   /filter-mapping

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Patrick Scheuerer
Shapira, Yoav wrote:

Howdy,
OK, now that's the 3rd different version of the filter elements in your
web.xml ;)  You shouldn't have both servlet-name and url-pattern
children of filter-mapping, only one of them.
I tried to add the filters with the Struts Studio Web Deployment Editor just as 
another test. It's quite interesting: Struts Studio tells me that servlet-name 
is required. But in the DTD it says servlet-url OR servlet-name. So i guess 
that's a bug in Struts Studio. It also put the empty servlet-name element 
there although left the field blank...

Anyway, I tried it with the correct version like this
filter
filter-nameUserFilter/filter-name
filter-classch.ctc.support.common.UserFilter/filter-class
/filter
filter
filter-nameAdminFilter/filter-name
filter-classch.ctc.support.common.AdminFilter/filter-class
/filter
filter-mapping
filter-nameUserFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping

filter-mapping
filter-nameAdminFilter/filter-name
url-pattern/admin/*/url-pattern
/filter-mapping


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Jeanfrancois Arcand
To be sure your web.xml is correct, turn xml validation on. In 
server.xml, replace:

 Host name=localhost debug=0 appBase=webapps
  unpackWARs=true autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
by

 Host name=localhost debug=0 appBase=webapps
  unpackWARs=true autoDeploy=true
  xmlValidation=true xmlNamespaceAware=true
That may help next time you see such problem.

-- Jeanfrancois

Patrick Scheuerer wrote:

Shapira, Yoav wrote:

Howdy,
OK, now that's the 3rd different version of the filter elements in your
web.xml ;)  You shouldn't have both servlet-name and url-pattern
children of filter-mapping, only one of them.


I tried to add the filters with the Struts Studio Web Deployment 
Editor just as another test. It's quite interesting: Struts Studio 
tells me that servlet-name is required. But in the DTD it says 
servlet-url OR servlet-name. So i guess that's a bug in Struts 
Studio. It also put the empty servlet-name element there although 
left the field blank...

Anyway, I tried it with the correct version like this
filter
filter-nameUserFilter/filter-name
filter-classch.ctc.support.common.UserFilter/filter-class
/filter
filter
filter-nameAdminFilter/filter-name
filter-classch.ctc.support.common.AdminFilter/filter-class
/filter
filter-mapping
filter-nameUserFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping

filter-mapping
filter-nameAdminFilter/filter-name
url-pattern/admin/*/url-pattern
/filter-mapping


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: cannot get Filters to work with Tomcat 5.0.16

2004-01-06 Thread Giuliano Gavazzi
At 11:36 am -0500 2004/01/06, Shapira, Yoav wrote:
Howdy,
OK, now that's the 3rd different version of the filter elements in your
web.xml ;)  You shouldn't have both servlet-name and url-pattern
children of filter-mapping, only one of them.
that's much better said then the original error message:

java.lang.IllegalArgumentException: Filter mapping must specify 
either a url-pattern or a servlet-name

I think plain english should be banned from error messages, for me an 
or is inclusive! It should say something like:

java.lang.IllegalArgumentException: Filter mapping must not specify 
both url-pattern and servlet-name

and reserve the other error message for when neither element is specified...

Giuliano
--
H U M P H
   || |||
 software
Java  C++ Server/Client/Human Interface applications on MacOS - MacOS X
http://www.humph.com/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]