Thank you Flip and Yoav for your help.  That cleared up a lot of confusion.

I have used the empty web.xml listed below, restarted tomcat, and everything
was fine.

I then added some taglibs to the web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!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>
<taglib>
        <taglib-uri>http://jakarta.apache.org/taglibs/c</taglib-uri>
        <taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
<taglib>
        <taglib-uri>http://jakarta.apache.org/taglibs/sql</taglib-uri>
        <taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
</web-app>


When I restart Tomcat, I get a 404 error.  Any ideas?


-----Original Message-----
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 12:20 PM
To: Tomcat Users List
Subject: RE: New User Web.xml question


Howdy,
You don't need to declare JSPs in your web.xml even though they really
are servlets, because there's a special servlet that serves JSP pages.
That servlet is declared and mapped in the master web.xml file located
in the $CATALINA_HOME/conf directory.

Start with a web.xml file that just has an empty webapp element:
<?xml version="1.0" encoding="ISO-8859-1"?>

<!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>
</web-app>


Alternatively, you can use the basic web.xml provided in the tomcat
"First Webapp" guide:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/web.xml.txt

(In general, I suggest reading
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/ before any of
your many printed books).

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, February 25, 2004 12:14 PM
>To: [EMAIL PROTECTED]
>Subject: New User Web.xml question
>
>Windows Server 2k, Tomcat 4.1.
>
>I'm relatively new at building web applications.  I'm ok with the
>programming, I've never learned how to make a web.xml file.
>
>I've gotten by on the invoker running all of my jsp pages.  It's now
time
>to
>do things right.  I have many books in front of me.
>NetBeans The Definitive Guide
>Tomcat Kick Start
>Apache Tomcat Bible
>Tomcat The Definitive Guide
>Web Development with JavaServer Pages
>CORE JSTL Mastering the JSP Standard Tag Library
>CORE Servlets and JavaServer Pages
>
>I still have no clue.  I only write jsp pages, no servlets.  I
understand
>that Tomcat converts this to a servlet.  I understand that this servlet
is
>a
>class.
>
>The sample web.xml in the ROOT directory of webapps does not mention a
>class, yet the index page runs.
>
>The sample web.xml in the examples directory of webapps has lots of
filter
>and filter-mapping entries.  I have only a vague idea of what they do.
>
>I have a few very simple webapps.  1 page to login, 1 page to search.
I
>would like to make a web.xml file for my webapps.  Right now, whatever
I
>try
>I get a 404 error when I restart Tomcat, then I delete the web.xml I
made
>and everything is good again.
>
>Can someone give me a tip.  If your webapp's root was
>\\webserver\www.company.com
><file:///\\webserver\www.company.com%20and%20you%20added%20test.jsp>
and
>you added test.jsp to that web app.  What entry would you make in your
>web.xml file?
>
>Thanks in advance.



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]

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

Reply via email to