Classpath Description of the Javaweb project

Source: Internet
Author: User

  Concept Explanation:

    Classpath: Web-inf below the classes directory in the project;

  

  Application:

Files under the "01" SRC Path are compiled and placed under the web-inf/clases path. The default classpath is here. If you put it directly under the Web-inf, it is not under the classpath.     With Classpathxmlapplicationcontext, of course, you can't get it. "02" If the unit tests, you can specify the path of the classpath in the startup or run options. When you build a project with MAVEN, the resource directory is the default classpath "03" classpath the compiled directory of the class file after the Java file is compiled is generally web-inf/classes, The XML under SRC is also copied to classpath at compile time.
New Classpathxmlapplicationcontext ("Xxxx.xml");  // Read the Spring.xml configuration file under Classpath New Filesystemxmlapplicationcontext ("Webroot/web-inf/xxxx.xml");   // read the Spring.xml file under Web-inf

difference:Classpath and classpath* differences:
Classpath: Only look for files in your class path;
Classpath*: Includes not only the class path, but also the jar file (the class path) to find.

Classpath Description of the Javaweb project

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.