You need to either provide a servlet mapping for your "Hi" servlet or 
access it like this:

http://localhost:8080/mine/servlet/Hi

Tomcat provides a default servlet mapping of /servlet/* in its web.xml in 
TOMCAT_HOME/conf

Also, you probably want to keep your servlet-name values non-spaced.  For 
instance, here is what you wrote:

     <servlet>
       <servlet-name>Initial Servlet</servlet-name>
       <description>
A Servlet to test Tomcat
       </description>
       <servlet-class>Hi</servlet-class>
     </servlet>

You probably want to do soemthing like:

     <servlet>
       <servlet-name>Initial_Servlet</servlet-name>
       <description>
A Servlet to test Tomcat
       </description>
       <servlet-class>Hi</servlet-class>
     </servlet>

Actually, you can also access your servlet by its servlet name like this:

http://localhost:8080/mine/servlet/Initial_Servlet

This efficacy of this is more apparent when your servlet is part of a 
package such as:

org.mycompany.myproject.core.tests.servlet.Hi

So, you would have:

     <servlet>
       <servlet-name>Initial_Servlet</servlet-name>
       <description>
A Servlet to test Tomcat
       </description>
       <servlet-class>org.mycompany.myproject.core.tests.servlet.Hi</servlet-class>
     </servlet>

Which can be accesed via:

http://localhost:8080/mine/servlet/org.mycompany.myproject.core.tests.servlet.Hi

or the more sane URL...

http://localhost:8080/mine/servlet/Initial_Servlet

If you add a mapping, it gets even easier:

<servlet-mapping>
         <servlet-name>Initial_Servlet</servlet-name>
         <url-pattern>/hi</url-pattern>
     </servlet-mapping>

Now you can access it as:

http://localhost:8080/mine/hi

or even...

<servlet-mapping>
         <servlet-name>Initial_Servlet</servlet-name>
         <url-pattern>/hello.html</url-pattern>
     </servlet-mapping>

http://localhost:8080/mine/hello.html


You should grab a good servlet book and read it.  You should have this 
stuff down within the first few chapters.

later,

Jake

At 09:41 PM 6/14/2002 -0400, you wrote:
>Hi I added a new context to my /usr/local/jakarta-
>tomcat-4.0.3/conf/server.xml called mine:
>
>         <!-- Tomcat Root Context -->
>         <!--
>           <Context path="" docBase="ROOT" debug="0"/>
>         -->
>
>         <!-- Tomcat Manager Context -->
>         <Context path="/manager" docBase="manager"
>          debug="0" privileged="true"/>
>
><!-- you probably want to set "reloadable"
>to "true" during development, but you should
>set it to be "false" in production. -->
>
>                 <Context path="/mine" docBase="mine" debug="0" 
> reloadable="true">
>                         <Logger 
> className="org.apache.catalina.logger.FileLogger"
>                                 prefix="localhost_mine_log." suffix=".txt"
>                         timestamp="true"/>
>                 </Context>
>
>         <!-- Tomcat Examples Context -->
>         <Context path="/examples" docBase="examples" debug="0"
>                  reloadable="true" crossContext="true">
>           <Logger className="org.apache.catalina.logger.FileLogger"
>                      prefix="localhost_examples_log." suffix=".txt"
>                   timestamp="true"/>
>           <Ejb   name="ejb/EmplRecord" type="Entity"
>                  home="com.wombat.empl.EmployeeRecordHome"
>                remote="com.wombat.empl.EmployeeRecord"/>
>
>
>
>
>
>
>-----------
>
>/usr/local/jakarta-tomcat-4.0.3/webapps/mine/WEB-INF/web.xml :
>
>
>          You can define any number of servlets, including zero.
>     -->
>
>     <servlet>
>       <servlet-name>Initial Servlet</servlet-name>
>       <description>
>A Servlet to test Tomcat
>       </description>
>       <servlet-class>Hi</servlet-class>
>     </servlet>
>
>--------------
>
>/usr/local/jakarta-tomcat-4.0.3/webapps/mine/WEB-INF/classes/:
>
>Hi.class
>Hi.java
>
>------------
>
>When I do a: http://localhost:8080/mine/Hi
>
>in a web browser.. I get a Tomcat resource not found:
>
>
>
>Apache Tomcat/4.0.3 - HTTP Status 404 - /mine/Hi
>------------------------------------------------------------------------
>
>type Status report
>
>message /mine/Hi
>
>description The requested resource (/mine/Hi) is not available.
>
>...
>
>
>I know Tomcat is running however since 
>http://localhost:8080/examples/servlet/RequestInfoExample
>
>will run that servlet.
>
>My server is probably running right now:
>
>http://www.taoki.org:8080/examples/servlet/RequestInfoExample
>
>
>any help would be appreciated!
>Michael
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to