contextConfigLocati...">

Is the "classpath:" prefix specific to Spring, or is it a JVM concept?

I have this in my web.xml:

<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-config.xml</param-value> </context-param> 

I suspect this is a convention used only by Spring? If so, will my application need more time to download, since I do not specify the direct location of the file, but now it should look for the entire path to the class?

+6
source share
1 answer

I suspect this convention is used only by Spring?

Yes, that means ClassPathResource and is part of the Spring Resource abstraction.

If so, will my application take longer to download, since I am not specifying the direct location of the file, but now it should look for the whole class path?

No, a) it uses the inner class ClassLoader, which should be fast enough. b) you really do not have much choice. using files is a very bad idea in the context of webapp because it makes you depend on implementation details that should be left on the implementation application server (WAR may or may not be unpacked).

+6
source

Source: https://habr.com/ru/post/890517/


All Articles