We have users which need tomcat and they need to develop java applications through Java Servlets and we have problem with mapping servlets.
I use one account for testing.
I try run servlet on cpanel tomcat 7 but seems it doesn't work. When i run servlet in jsp file that is ok but mapping servlet doesn't work.
So setup is ok I put web.xml in web-inf folder and all other stuffs are in correct place
Here is web.xml
When i open url domain.com/TestServlet
I got error page is not found.
Here is example where I run servlet from JSP file and that is ok.
domain.com/jsps.jsp
What is problem with mapping? It's seems that cpanel dont read web.xml file?
I use one account for testing.
I try run servlet on cpanel tomcat 7 but seems it doesn't work. When i run servlet in jsp file that is ok but mapping servlet doesn't work.
So setup is ok I put web.xml in web-inf folder and all other stuffs are in correct place
Here is web.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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">
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>com.i_do2.java.TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>indexp.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
I got error page is not found.
Here is example where I run servlet from JSP file and that is ok.
domain.com/jsps.jsp
Code:
<%@page contentType="text/html" pageEncoding="UTF-8" import="com.i_do2.java.TestServlet"%> <% TestServlet ts = new TestServlet(); ts.service(request, response); %>