I have created a java class "DemoClass" in netbeans.specified the servlet and servlet-mapping in web.xml.but when i run the class it shows Servlet DemoClass is not available. please help asap...
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
Welcome to JavaRanch.
Is the class located in the WEB-INF/classes directory? Is the class name (and the servlet name - twice) spelt correctly in the web.xml file?
By this you mean a ClassNotFoundException is thrown ? Perhaps the class is not loaded correctly as Ulf suggests. Did you mention the fully qualified name of the class correctly ?
Thanks for the quick reply. in my web.xml i defined
<servlet>
<servlet-name>DemoClass</servlet-name>
<servlet-class>sample.js.DemoClass</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>