facebook

getting problem in jsf-spring integration

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #266865 Reply

    arsal
    Member

    Hi,
    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

    #266993 Reply

    Riyad Kalla
    Member

    Moving 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.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: getting problem in jsf-spring integration

You must be logged in to post in the forum log in