<bean id="myString" class="java.lang.String">
<constructor-arg type="java.lang.String" value="Lucio"/>
</bean>
<bean id="myUser" class="com.benfante.User">
<property name="firstName" ref="myString"/>
</bean>
Thanks to Lucio for the example
<bean id="myString" class="java.lang.String">
<constructor-arg type="java.lang.String" value="Lucio"/>
</bean>
<bean id="myUser" class="com.benfante.User">
<property name="firstName" ref="myString"/>
</bean>
package webscheduler.bo;
@Component
public class SchedulerBo {
...............................
}
<context:component-scan base-package="webscheduler.bo"/>
19:17:09,706 ERROR [ContextListener] Error in base ContextListener.contextInitialized
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobNormal' defined in ServletContext resource [/WEB-INF/schedulerContext.xml]: Cannot resolve reference to bean 'schedulerBo' while setting bean property 'jobDataAsMap' with key [TypedStringValue: value [schedulerBo], target type [null]]; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'schedulerBo' is defined
............................................................
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'schedulerBo' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.
getBeanDefinition(DefaultListableBeanFactory.java:387)
private WebApplicationContext applicationContext;
.....................................
config.add("WEB-INF/schedulerContext.xml");
XmlWebApplicationContext ctx = new XmlWebApplicationContext();
ctx.setServletContext(servletContext);
ctx.setConfigLocations(config.toArray(new String[config.size()]));
ctx.refresh();
applicationContext = ctx;
XmlWebApplicationContext ctx = new org.jboss.spring.factory.VFSXmlWebApplicationContext();
<dependency>
<groupId>org.jboss.snowdrop</groupId>
<artifactId>snowdrop-vfs</artifactId>
<version>1.0.0.GA</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
XmlWebApplicationContext ctx = new org.jboss.spring.factory.VFSXmlWebApplicationContext();
<spring:message code="Email" />
Email=E-Mail
<spring:message code="Email" text="?Email?"/>
BeanAutoInjecting bai = new BeanAutoInjecting();
public BeanAutoInjecting()
{
ApplicationContext ctx = SpringLoader.getApplicationContext();
AutowiredAnnotationBeanPostProcessor aabpp = (AutowiredAnnotationBeanPostProcessor)ctx.getBean(
"org.springframework.context.annotation.
internalAutowiredAnnotationProcessor");
aabpp.processInjection(this);
}
public BeanAutoInjecting(int a)
{
System.out.println("I am the dummy constructor!");
}
<!-- auto wiring directive -->
<context:component-scan base-package="spikes.springexamples"/>
---------------------------
<!-- bean definition with dummy constructor ->
<bean name="beanAutoInjecting" class="spikes.springexamples.BeanAutoInjecting">
<constructor-arg>15</constructor-arg>
</bean>
<!-- start mail section -->
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<!-- here your smtp server -->
<property name="host"><value>smtp.gmail.com</value></property>
<!-- Parameters for SMTP AUTH -->
<property name="username"><value>yourUsername</value></property>
<property name="password"><value>yourPassword</value></property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<!-- used by gmail smtp server -->
<prop key="mail.smtp.starttls.enable">true</prop>
</props>
</property>
</bean>
org.springframework.mail.MailSendException; nested exception details (1) are: Failed message 1: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first z37sm13522675ikz.1 at