Hi,

I'm using dependency injection via @SpringBean, and I need access to
configurable String value in my Application class.

My main context file is using a
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer which
allows me to use ${} syntax for wiring values from a set of properties files
directly to a bean definition.

Eg,
GenericNonWicketApp.properties
  configDir=/usr/banana/config

AppContext.xml
<bean class="someclass">
  <property name="configDir" value="${configDir}" />
</bean>
  
I'd like to be able to wire this value against the WebApplication in wicket,
and I have been able to do this as follows:

<bean id="configDir" class="java.lang.String">
    <constructor-arg index="0" value="${configDir}" />
</bean>

MyWebApplication.java
  @SpringBean(name = "configDir")
  private String configDir;


Is this the desired way of configuring these type of things (eg, simple
objects such as Strings and Integers)?
-- 
View this message in context: 
http://www.nabble.com/How-to-...-nicely-wire-%22strings%22-through-spring.-tp18189203p18189203.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to