i use tomcat + cpanel . my jsps and tags correct run but can not run servlet .
my web.xml content is :
<servlet>
<servlet-name>Servlet1</servlet-name>
<servlet-class>pack1.Servlet1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/Servlet1</url-pattern>
</servlet-mapping>
when request http://www.mydomain.com/Servlet1 get this error (404) :
Not Found
The requested URL /Servlet1 was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
please help me.
The cpanel suggests that you’re using a 3rd party host. A lot of cheapass 3rd party hosts have due to system limitations different rules for deploying servlets. You should be reading their developer guide/documentation/FAQ how exactly to properly deploy servlets on their host. For example, some 3rd party hosts require a specific folder or package structure, or they require a specific URL structure.
Godaddy, for example, requires you to use the URL structure
/servlet/YourServletClassName, with the/servletprefix path, see also their FAQ.If you want to have full control over deployment or want to follow standard Java EE rules, you’d rather look for a different host. For example, OpenShift, which is a completely free cloud hosting service using the full fledged JBoss AS 7 application server, including EJB and JPA support and all on em and the free choice between MySQL and PostgreSQL databases.