I tried to start with Tomcat 7.
I created the application in Eclipse. Here is my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID" version="2.4">
<welcome-file-list>
<welcome-file>
view.jsp
</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>myServlet</servlet-name>
<servlet-class>/servlets/myServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/myServlet</url-pattern>
</servlet-mapping>
</web-app>
I downloaded the lastest Tomcat from Apache's site, and added JAVA_HOME
to catalina.bat
. After starting Tomcat I went in Manager app
and chose my application but got 404. In the address line - http://localhost:8080/ThreeRest/
.
Another strange thing is that the application didn't deploy into webapps
directory but into wtpwebapps
folder.
My other problem with tomcat-users.xml
. If I add this:
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="admin,manager,manager-gui"/>
Its work only in one session. When I stop tomcat it is removed from file.