• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Servlet and XML file..

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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"
"http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
<servlet>
<servlet-name>
ShowMsg
</servlet-name>

<servlet-class>
coreservlets.ShowMessage
</servlet-class>

<init-param>
<param-name>
message
</param-name>
<param-value>
Chakravarthy
</param-value>
</init-param>

<init-param>
<param-name>
repeats
</param-name>
<param-value>
5
</param-value>
</init-param>
</servlet>
</web-app>
**************************************************
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?
Chuck
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
<init-param><param-name>message</param-name>
<param-value>Chakravarthy</param-value>
</init-param>
just in case the server is not trimming blanks from the values.
(just a guess)
Bill

------------------
author of:
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic