Servlet - Requested Resource is not available

I have a servlet named ControllerServlet in this directory C:\Tomcat 6.0\webapps\burnaby\WEB-INF\classes\  
I have the following deployment descriptor.  I keep getting the error that the requested resource is not available.  I use this link on my local machine.  http://localhost:8081/burnaby/servlet/ControllerServlet

I am stuck and am not sure what I am doing wrong.  

<?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>
  <!-- Define the controller servlet -->
  <servlet>
    <servlet-name>ControllerServlet</servlet-name>
    <servlet-class>ControllerServlet</servlet-class>
    
    <servlet-mapping>
    <servlet-name>ControllerServlet</servlet-name>
    <url-pattern>/servlet/ControllerServlet</url-pattern>
    </servlet-mapping>
 
    <!-- Define initial parameters that will be loaded into 
       the ServletContext object in the controller servlet -->
    <init-param>
      <param-name>base</param-name>
      <param-value>http://localhost:8081/burnaby/servlet/ControllerServlet</param-value>
    </init-param>
    <init-param>
      <param-name>jdbcDriver</param-name>
      <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
    </init-param>
    <init-param>
      <param-name>imageUrl</param-name>
      <param-value>http://localhost:8081/burnaby/images/</param-value>
    </init-param>
    <init-param>
      <param-name>dbUrl</param-name>
      <param-value>jdbc:odbc:Burnaby</param-value>
    </init-param>
    <init-param>
      <param-name>dbUserName</param-name>
      <param-value></param-value>
    </init-param>
    <init-param>
      <param-name>dbPassword</param-name>
      <param-value></param-value>
    </init-param>
  </servlet>
</web-app>

Open in new window

monica73174Asked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
 
    ControllerServlet
    ControllerServlet


thats also missing a closing
0
 
objectsCommented:
try moving ControllerServlet class into a package

0
 
objectsCommented:
eg. to move it into package controller you would

1. add package statement to ControllerServlet class

package controller;

public class ControllerServlet ....

2. The class will now be in WEB-INF/classes/controller

3.  change mapping to:

 
    ControllerServlet
    controller.ControllerServlet
   

0
 
monica73174Author Commented:
I had the servlet-mapping inside the servlet tag.  Your last answer helped a lot.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.