- This topic has 1 reply, 2 voices, and was last updated 17 years, 10 months ago by Riyad Kalla.
-
AuthorPosts
-
arsalMemberHi,
We have a web application in which we are working on JSF using MyEclipse. I am now trying to integrate spring framework into the project for having IOC for middle layer.
well I am getting problem in setting class attribute through Spring.
How I did is I added a class First.java initialized by application.xml The code is
<beans>
<bean id=”first” class=”com.model.service.impl.first”
abstract=”false” singleton=”false” >
<property name=”name”>
<value type=”java.lang.String”>to enter</value>
</property></bean>
</beans>In web.xml I did the following change for Spring
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>I added this first class in backing bean as a property. My faces-config.xml code is
<managed-bean>
<managed-bean-name>EducInfo</managed-bean-name>
<managed-bean-class>
com.view.beans.StudentEducInfo
</managed-bean-class>
<managed-property>
<property-name>ft</property-name>
<value>#{first}</value>
</managed-property>and I called it from jsp(JSF) page as
<h:outputText value=”#{EducInfo.tstFirst}” />the function tstFirst in EducInfo (backing bean) is
private first ft;
public String getTstFirst() {
tstFirst=ft.getName();
return tstFirst;
}I am getting error ‘Expression Error: Named Object: ‘first’ not found.’
Any idea? Any workaround would also be appreciated
Regards,
Arsalan
Riyad KallaMemberMoving to OT > Soft Dev
Arsalan,
This is a spring-specific question, I’m moving it to our public forum to see if other folks could help out. -
AuthorPosts