Dynamic deployment in Tomcat

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.