My applicationContext.xml:
<bean id="studentService" class="com.coe.StudentService">
<property name="studentProfile" ref="studentProfile" />
</bean>
<bean id="studentProfile" class="com.coe.student.StudentProfile">
</bean>
My web.xml:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
My classes:
StudentService{
private StudentProfile studentProfile;
//has appropriate getters/setters
}
StudentProfile{
private String name;
//has getter/setter
}
i have a jsp that calls studentService.studentProfile.name, and the error says that studentProfile is null
My assumption is that when the server starts up, Spring instantiates all objects as requested, so when the StudentService is called, would not Spring also set StudentProfile?