• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

== Filter Problem ==

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I installed JDK1.4 & Tomcat 4.0.2 just to rule out some potential sources of my problem.
When I put this code in my web.xml file


I get this error


Create Catalina server
Starting service Tomcat-Standalone
Apache Tomcat/4.0.2
PARSE error at line 88 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*)".


here is my DTD
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">;

I'm using the right servlet.jar version but I can't seem to find what is causing this problem. When I remove the <filter> & <filter-mapping> tags from my web.xml I don't get errors..

Can anybody tell me what I'm doing wrong ? It would be very much appreciated
Dave
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Order, Order, Order.

It's a mantra when doing XML.

Not only does a tag need to be contained within the right tag, it needs to be in order.

So... where is your <filter> and <filter-mapping> tags, in relation to all the other tags that belong inside <web-app> ?

They must be after any <context-param> elements, but before any <listener> elements.
 
Dave Van Even
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cheers mike !!
I've put the <servlet> & <servlet-mapping> tag in the right place now... works smootly
Dave
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic