Announcement Announcement Module
Collapse
No announcement yet.
Spring beans in JSF components Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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.

    Comment

    Working...
    X