permaculture playing cards
The moose likes Servlets and the fly likes Servlet and XML file.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet and XML file.." Watch "Servlet and XML file.." New topic

Servlet and XML file..

Chuck Meduri
Ranch Hand

Joined: Nov 29, 2000
Posts: 48
I created a xml file (web.xml) which is given below as shown in the book
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"



I am trying to use the elements in here in a servlet. This is an example that I trying a book ( Coreservlets and JSP by Marty Hall). When I put this web.xml in the d:\resin1.2.1\doc\web-inf directory and start the resin server, it gives me a error saying...
CANNOT MIX TEXT AND ELEMENTS AT WEB-APP followed by a bunch of exceptions.
I do not know any XML and I just started learning servlets..
Could somebody help me?
Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
Hi, I don't know much about resin, but most servers have a webapps directory(for Web Applications) then under it there are the application directories (usually the name of the application, like MyCatalog) under the application directories there are the Web-inf directories. And then classes and lib such. Maybe you can try tomcat if you really can't get resin to work.
[This message has been edited by Bob Moranski (edited December 22, 2000).]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
It looks to me like it is objecting to something about the formatting in the web.xml file. You need to find an XML checking utility to make sure it is well formed. Unfortunately, the one I use (Clip) seems to have gone out of business!
You might try closing up the tags like this:
just in case the server is not trimming blanks from the values.
(just a guess)

author of:
I agree. Here's the link:
subject: Servlet and XML file..
It's not a secret anymore!