study notes
  • Introduction
  • Oct 14, 2016
  • Oct 22, 2016
  • Oct 27
  • Nov1
  • j2ee context root(4.19.2017)
  • June 20, 2017(bTrade debug record)
  • Sep 5, 2017
  • Jan 4, 2018
  • Jan 5, 2018Deploy war file to Tomcat
  • Jan 13,2018, hibernate config
  • conflict caused by PR
  • using another project's class
  • intellij cannot resolve the symbols in target folder
  • keyboard symbol
  • Oct 31, 2018
  • tax build construction simplify &effecticent
  • line ending
  • memory leak
  • Serializable
  • To learn
  • What happens when you type 'google.com' into a browser and press Enter?
  • security scan for software
Powered by GitBook
On this page

Was this helpful?

Jan 5, 2018Deploy war file to Tomcat

Student name: ${param.studentName} error:

error: Encountered "<EOF>" at line 1, column 1.

Was expecting one of:

&lt;INTEGER\_LITERAL&gt; ...

&lt;FLOATING\_POINT\_LITERAL&gt; ...

&lt;STRING\_LITERAL&gt; ...

"true" ...

"false" ...

"null" ...

"\(" ...

"-" ...

"not" ...

"!" ...

"empty" ...

&lt;IDENTIFIER&gt; ...

doesn't matter. jsp still works.

  1. Deploying your App to Tomcat as a Web Application Archive (WAR) file

When you deploy your Java web apps, you can make use of a Web Application Archive (WAR) file.

The Web Application Archive (WAR) file is a compressed version of your web application. It uses the zip file format but the file has the .war extension.

If you are using Eclipse, then the best way to visualize it is think of your "WebContent" directory being compressed as a zip file with the .war extension.

This includes all of your web pages, images, css etc. It also includes the WEB-INF directory which includes your classes in WEB-INF/classes and supporting JAR files in WEB-INF/lib.

The WAR file format is part of the Java EE / Servlet specification. As a result, all Java EE servers support this format (ie jboss, weblogic, websphere, glassfish and tomcat).

Below, I provide steps on how to create a WAR file in Eclipse. I also show how to deploy the WAR file on Tomcat.

  1. In Eclipse, stop Tomcat

  2. Right-click your project and select Export > WAR File

  3. In the Destination field, enter: <any-directory>/mycoolapp.war

  4. Outside of Eclipse, start Tomcat

  5. If you are using MS Windows, then you should find it on the Start menu

  6. Deploy your new WAR file by copying it to <tomcat-install-directory>\webapps

Give it about 10-15 seconds to make the deployment. You'll know the deployment is over because you'll see a new folder created in webapps ... with your WAR file name.

PreviousJan 4, 2018NextJan 13,2018, hibernate config

Last updated 5 years ago

Was this helpful?

Make sure Tomcat is up and running by visiting:

Visit your new app. If your war file was: mycoolapp.war then you can access it with:

http://localhost:8080
http://localhost:8080/mycoolapp/