简体   繁体   中英

Deploying a WAR file to Tomcat 7

I am trying to deploy a web application (WAR file) to Tomcat 7 using the command line, but i'm doing something wrong. I keep getting the 404 error, but I can access the html files using the localhost:8080/App_hame/file_name.html syntax.

I deploy files to server this way: I set the CATALINA_HOME and JAVA_HOME variables, start the server this way:

SET CATALINA_HOME=C:\my_path\apache-tomcat-7.0.69
SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
startup.bat

Then I copy the WAR file to webapps folder of the server and then restart the server. I can see the file unpacking to an App_name directory in webapps folder, but i can't access the application from the browser using the mentioned url.

I am probably missing a step or so, so please, can somebody explain it to me what i'm doing wrong.

Thanks to anyone who replies!

Check that you have an entry in your web.xml mapping your servlet to the url-pattern

<servlet-mapping>
    <servlet-name>EntryServlet</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM