I have two questions regarding classpath:
option in spring :-
1) Does classpath:
search for resource relative to the document in which it is specified(in case of web applications)?
Suppose I use the following:
<bean class="mybean">
<property name="myresource" value="classpath:myfile.txt"/>
</bean>
in myconfig.xml under /WEB-INF/classes/config/myconfig.xml. Then from where it will start its search?
2)Is it faster to search if I give direct location of the resource instead of giving classpath:
i.e
<bean class="mybean">
<property name="myresource" value="classpath:/WEB-INF/classes/myfolder/myfile.txt"/>
</bean>
instead of
<bean class="mybean">
<property name="myresource" value="classpath:myfile.txt"/>
</bean>
Thanks...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…