Results 1 to 2 of 2

Thread: Spring beans in JSF components

  1. #1

    Default Spring beans in JSF components

    Hi!

    Maybe a dumb question, but I figured somebody here might know the answer: I have a JSF application with Spring, Facelets and MyFaces. I'd like to write a custom JSF component now which would need to use a Spring bean. How do I inject it in the component?

    As an example, I have a LinkBuilder service class which builds custom links. Rather than creating every URL I might need in my action class and storing it in a bean, I'd like to do something like this to output a link tag:

    <my:link ... />

    I'd probably extend the h:outputLink component here. But how do I get my service class, since the component instance is generated by JSF? Or does this simply not work?

    Regards,
    Johannes
    Spring 2.5.6, Spring WebFlow 2.0.8, MyFaces 1.2.5, Facelets, JDK 1.6.0, Tomcat 6

  2. #2
    Join Date
    Jul 2010
    Posts
    5

    Default

    Did you ever find a solution for this Ammaletu? I want to do something similar for some custom selectItems that I want to retrieve from a spring managed service.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •