Java URL protocol: classpath: /?
I see some spring code that uses the classpath: / some / path / to / resource URL protocol to read configuration files and other resources directly from the runtime classpath
Is this a spring construct or a Java construct?
Except for this problem - URL to load resources from the classpath in Java, I can't find any files, which doesn't mean any way
If it's a Java construct, can anyone point out my official documents?
Solution
Then you can register the URL handler at any time Java also has a file: / / / and jar: handler By default, class Getresource will read from the classpath
http://code.google.com/p/madura-classpath-protocol-handler/
Obviously, this is the characteristic of spring
"You can see these standard handlers and related implementation classes in the rt.jar file of JDK, and find the classes whose fully qualified name starts with sun.net.www.protocol. For example, sun.net.www class. Protocol.http.handler defines HTTP protocol handler, and sun.net.www.protocol.ftp.handler defines FTP protocol handler
http://java.sun.com/developer/onlineTraining/protocolhandlers/
"Exceptions in threads" main "Java. Net. Malformedurlexception: unknow protocol: classpath" (Java 1.6)