Web-inf configuration file access in the SRC package in the profile method

Source: Internet
Author: User
Tags config manual hosting root directory


First try spring hosted struts, The Applicationcontext.xml file for the example in the Spring application manual is placed in the Web-inf, and the Applicationcontext.xml file that you generated with eclipse is placed in the SRC root directory. When hosting, the Struts-config.xml file should be configured as follows:
<plug-in classname= "Org.springframework.web.struts.ContextLoaderPlugIn" >
<set-property property= "contextconfiglocation" value= "/web-inf/applicationcontext.xml"/>
</plug-in>
This is the example in the spring User manual, but the hosting is unsuccessful because the Applicationcontext.xml configuration file is placed in the SRC directory. Directly cut the Applicationcontext.xml file to Web-inf, the results managed successfully, but other programs can not find Applicationcontext.xml ... If you change the configuration/web-inf/applicationcontext.xml in the Struts-config file to/applicationcontext.xml, or not ... Depressed... Ask the friends in the group, no one answered ... Find relevant information on the Internet, also did not find ... Depressed to the extreme.
A careful look at the code, suddenly dawned. It's so stupid. Since can write/web-inf/applicationcontext.xml, not also can write/web-inf/classes/applicationcontext.xml. /web-inf/classes/is not the SRC compiled directory.
Pour ....

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.