idea publish web project in question tomcat position

 

 

 

(1) war mode that can be called a release mode, see the name also know that this is the first package labeled as war, then release.

(2) war exploded mode is directly to the folder, jsp pages, classes, and so moved to the Tomcat deployment folder inside, loaded deployment. So in this way it supports hot deployment, but also the general development at the time this way.

(3) In peacetime, when developed, using hot deployment, it should be the appropriate settings for Tomcat, so modify the interface jsp what things can promptly displayed.

After Baidu search information to know, the idea of ​​the configuration in tomcat, at runtime idea not to put the project under its own webapps path, but in the $ {user.home} /. IntelliJIdea / system / tomcat directory.

 

<Context path="/tcc" docBase="C:\Users\SWEETGUO\IdeaProjects\workspace\out\artifacts\project2_war_exploded2" />

 

docBase deployment location is simply more operation items, D: \ java \ IDEAWorkSpace \ item item is the location of the source code, target is generated after the maven constructed.

working process:

First Intellij will create a separate folder to "Unnamed_ project name" name (can be modified .idea / workspace.xml in) for every web project.

Each time the project starts, it first tomcat directory under the original copy of CATALINA_BASE directory to the directory, which is the copy of the current configuration file to tomcat "Unnamed_ project name" folder.

CATALINA_BASE then modify the path for the directory path, and then add a profile ROOT.xml projects under Unnamed_ project name / conf / Catalina / localhost.

Finally start tomcat, tomcat in addition to outside applications will load the application configured in / conf / Catalina / localhost will start at webapps, and in this way Intellij is "hidden" to load web projects.

Guess you like

Origin www.cnblogs.com/zhaoyanhaoBlog/p/10958219.html