JAVA WEB project deployment

1. Confirm that the project is available.

 

2. Find [file]-[project structure] and click to enter.

 

3. Open the artifact and select it.

4. Select Web Application Archive of type Type.

5. Check Bulid on make and click Apply

6. Select [Build]-[Build Artifacts], and select Build after the pop-up box

 

7. The generated war package can be found in the previous Output directory.

8. Local tomcat deployment WAR package

1) Place the WAR package under the webapp directory of tomcat.

 

 

2) Open the conf directory of tomcat, find the server.xml file, and configure it.

  Find the "<Context>" tag, set the path and docBase.

             path: specifies the URL entry for accessing the web application

             docBase: Specify the file path of the web application, either an absolute path or a relative path relative to the appBase attribute of <Host>. If the web application adopts an open directory structure, specify the root directory of the web application. is a war file, specify the path of the war file.

For example, my settings are: <Contextpath="/sjqy" docBase="D:\ProgramFiles\Java\tomcat8\webapps\DataMigrationPlatform_Web exploded.war"/>

3) Run tomcat to test the interface.

Select the bin folder of tomcat, find startup.bat and double-click to run (if not, you can run tomcat.exe directly)

At this point, you can see that the project runs successfully.

 

Note: The location of the WAR package does not have to be under WepApp, as long as it is consistent with Server.xml.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325012202&siteId=291194637