I have a simple servlet say com.test.HelloWorld.class
then I create these folders tree:
WEB-INF -->
lib
classes -->
com -->
test -->
HelloWorld.class
web.xml
where web.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<servlet>
<servlet-name>helloworld</servlet-name>
<servlet-class>
com.test.HelloWorld
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>helloworld</servlet-name>
<url-pattern>/servlets</url-pattern>
</servlet-mapping>
</web-app>
after I create a .war called servlets.war and put it inside the autodeploy dir of the GlassFish server.
After I point the url: localhost:8080/servlets/helloworld but I have a 404 error.
Why? What's worng?
Thanks.