java - Springframework beans -


i have not until had worked spring framework. tried reading , reading spring documentation not locate answer following simple question.

the application ant built build directory. far when tried start jboss (or apache) server, logs says unable build bean because not find

var/config/madagascar.prop. . wrt following snippet in web-inf/applicationcontext.xml

<bean id="application.home" class="org.springframework.beans.factory.config.methodinvokingfactorybean">     <property name="targetclass" value="java.lang.system"/>     <property name="targetmethod" value="getproperty"/>     <property name="arguments">         <list>             <value>application.home</value>         </list>     </property> </bean> <bean id="propertyfile" class="java.io.file">     <constructor-arg ref="application.home"/>     <constructor-arg value="var/config/madagascar.prop"/> </bean> 

could tell me {application.home} , var/config expected located?

is relative eclipse project home or relative web-inf?

what bean id="application.home" attempting - trying read value "application.home" system env?

"application.home" runtime value of system.getproperty("application.home") , "propertyfile" bean java.io.file object returned calling new java.io.file(string, string) whatever application.home set , second string.

if bean wanted 'propertyfile', runtime equivalent be:

file file = new file(system.getproperty("application.home"),"var/config/madagascar.prop"); 

that config spring 1.x (read old) way of doing things. xml kludgy way perform many of these types of initialization, , that's 1 of reasons spring's @javaconfig approach became popular.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -