Dynamic deployment in Tomcat
1 Configuring the dynamic deployment of Tomcat first
1.1 If the JDK is installed, then install Tomcat. After the installation is completed, enter http://192.168.1.208:8080/, a kitten's page will appear, click on the right side of the manager app will prompt to enter the user name, password
The following page appears when you cancel, and you need to add the manager profile.
Find Tomcat-users.xml
General Position:/usr/local/tomcat/conf/tomcat-users.xml
<tomcat-users>
<rolerolename= "Manager-gui"/>
<rolerolename= "Manager-script"/>
<role rolename= "Manager-jmx"/>
<rolerolename= "Manager-status"/>
<user username= "admin" password= "admin" roles= "Manager-gui,manager-script,manager-jmx,manager-status"/>
</tomcat-users>
Then reboot tomcat and login with admin to see the Tomcat Dynamic Deployment page. We deploy with war file to deploy
1.2 IntelliJ idea generates a war file. In Projectstructure, select artifacts to generate the war.
Then generate the war in the Build menu
Finally released in Tomcat
2 SPRINGMVC possible problems deploying in Tomcat
Here are some of the problems and solutions I've encountered
The first is the war project running on IntelliJ idea no problem.
Issues encountered in deploying to Tomcat
The 2.1 JS file cannot be found.
We sometimes write when we're programming.
<script src= "/res/js/search.js" type= "Text/javascript" ></script>
However, in the deployment to TOMCA will be the default plus the project name, resulting in the file can not find the situation, you need to write the file reference in the following format
<scriptsrc= "${request.getcontextpath ()}/res/js/search.js" type= "Text/javascript" ></script>
2.2 Front-end delivery to the background garbled or query SQL query with Chinese parameters is not data. Here is an encoding format that does not specify Tomcat. All you have to do is modify the server configuration of Tomcat.
Locate the file/usr/local/tomcat/conf/server.xml
Plus the parts in the red box
2.3 Front Desk page slow problem,
For example, the front page refers to the online JS, not the JS on this site
<scriptsrc= "Http://code.jquery.com/jquery-1.9.1.min.js" ></script>
At this point, this JS download to the program and then reference.
<script src= "${request.getcontextpath ()}/res/js/jquery-1.9.1.min.js" ></script>