users@glassfish.java.net

Cannot get _at_ManagedProperty to work

From: <glassfish_at_javadesktop.org>
Date: Sun, 19 Sep 2010 13:08:47 PDT

This is really bugging me. I can get managed properties to work with tags in faces-config.xml but I am trying to use @javax.faces.bean.ManagedProperty instead. Below is my whole source code, and the bean gets instantiated but the setters for param1 and param2 never get called. Am I doing something wrong?

[code]
package test10;

import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import javax.inject.Named;

/**
 *
 * @author alandeikman
 */

@Named (value="goHere")
@RequestScoped
public class GoHere {

    @ManagedProperty(value="DefaultValue")
    private String param1;

    @ManagedProperty(value="#{param['toot']}")
    private String param2;
    
    public GoHere() {

    }

    public String getParam1() {
        return param1;
    }

    public void setParam1(String param1) {
        this.param1 = param1;
    }

    public String getParam2() {
        return param2;
    }

    public void setParam2(String param2) {
        this.param2 = param2;
    }

    public String getParam3() { return "fixedValue"; }

}

[/code]
[Message sent by forum member 'alan94539']

http://forums.java.net/jive/thread.jspa?messageID=483098