Web. XML Webapprootkey

Source: Internet
Author: User

Web. XML Webapprootkey------------------------------------------------------------------------------------------------1 , Web. XML configuration webapprootkey webapp.root The string "Webapp.root" can be arbitrarily written in any string. If you do not configure the default value is "Webapp.root". You can use System.getproperty ("Webapp.root") to dynamically get the project's running path. General return results For example:/usr/local/tomcat6/webapps/project Name 2, resolve the following error The Web project deployed in the same container, to configure a different , cannot be duplicated, otherwise the report resembles the following error: Web App root system property already set to different value: ' Webapp.root ' = [/home/user/tomcat/webapps/p ROJECT1/] instead of [/home/user/tomcat/webapps/project2/]-Choose unique values for the ' Webapprootkey ' Context-param in Your web files! meaning "Webapp.root" This key has been pointed to the project 1, can not point to the project 2.3, loading mode spring through Org.springframework.web.util.WebAppRootListener The project path at which this listener comes to run. However, if the Org.springframework.web.util.Log4jConfigListener listener is already configured in Web. XML, you do not need to configure Webapprootlistener. Because Log4jconfiglistener already contains the general configuration type of the Webapprootlistener function, the following example: XML code log4jconfiglocation web-inf/conf/log4j.properties log4jrefreshinterval Org.springframework.web.util.Log4jConfigListener 4, at run time dynamically find the path of the project in the Log4j.properties configuration file, you can use the following way ${webapp.root}: log4j.appender.file.file=${webapp.root}/ Web-inf/logs/sample.log can dynamically find the path to the project at run time

(EXT) Web. XML Webapprootkey

Related Article

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.