Cagatay Civici’s Weblog

“Real power can’t be given, it must be taken”

Annotate JSF Beans with Spring 2.5

Posted by cagataycivici on December 19, 2007

I’ve moved my blog, the link for the actual post is;

http://prime.com.tr/cagataycivici/?p=94

5 Responses to “Annotate JSF Beans with Spring 2.5”

  1. Rene Says:

    Any idea whether there is a difference between:
    # @Component
    # @Scope(”request”)
    # @Qualifier(”saveDVDBean”)

    and:

    @Controller(”clientSI”)
    @Scope(”request”)
    public class ClientSI extends BaseSI implements BaseSIIntf {

    @Resource(name = “clientManager”)
    public void setManager(ClientManager manager) {
    this.manager = manager;
    }

    At least my managed bean seem to work but I am very confused with all those annotations

  2. cagataycivici Says:

    Yes, @Controller will work too but afaik it’s for Spring MVC framework and methods of a class annotated with @Controller are scanned for request mappings. You dont need that in JSF. @Component is simpler and enough.

  3. Sakuraba Says:

    wow… Spring is just like Seam. Never thought this would happen after all the JBoss vs Spring wars.

  4. Alexander Lendl Says:

    great!

    … but how do I replace the stuff from the faces-config with spring annotations?

    e.g.

    saveDVDBean

    request

    id
    #{param.id}

    thanx!

  5. Alexander Lendl Says:

    sorry… the manged bean stuff is not displayed as desired… next try:

    saveDVDBean
    ...
    request

    id
    #{param.id}

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>