0

Servlet tag and servlet mapping tag are present in the web.xml as shown below

<servlet>
     <servlet-name>AbcServlet</servlet-name>
     <servlet-class>edu.studies.service.AbcServlet</servlet-class>
     <load-on-startup>0</load-on-startup>
   </servlet>
  
  <servlet-mapping>
    <servlet-name>AbcServlet</servlet-name>
    <url-pattern>/abc/*</url-pattern>
  </servlet-mapping>

But it still says The requested resource (Servlet AbcServlet is not available) is not available. What did I miss? Please help.

3
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by ~s.o.s~
0

Are you sure that your servlet after compile was placed in correct directory PROJECT/WEB-INF/classes/edu/studies/service/AbcServlet ?

0

Thanks for responding. Yes, I am sure. I even checked the WAR file expanded by Tomcat to ensure that the class file is in appropriate location.

I suspect that the problem has something to do with finding the <servlet-name> tag itself rather than finding the appropriate servlet class. Because if I change the <servlet-name> tag value from AbcServlet to AbcdServlet in both <servlet> and <servlet-mapping>, the error becomes The requested resource (Servlet AbcServlet is not available) is not available.

Well, I am just a newbie and this is only my guess.

0

But it still says The requested resource (Servlet AbcServlet is not available) is not available. What did I miss? Please help.

What do the Tomcat logs say? If you see nothing unusual there, paste the URL you are trying to hit along with the directory structure you are using for your class.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.