Outjected Component Null
kem May 21, 2010 9:37 PMHi
I am testing Bijection with the following code. The Injection is OK, but @Out always outject null.
Any idea what is wrong in this code. Many Thanks
@Name("person")
public class Person {
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
the following class rename the firstName and Outject Person.
@In pesron is OK. But @Out person is always null.
@Stateful
@Name("rename")
public class PersonRename implements Rename {
@In @Out
Person person;
public String rename() {
String fn = person.getFirstName();
person.setFirstName("renamed-" + fn);
return "/confirm.xhtml";
}
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
@Remove
public void destroy(){};
}
@Out person is injected in manager
. But injected person is always Null.
@AutoCreate... for person
is not useful, as the firstName and lastName are set from the view.
@Stateful
@Name("manager")
public class PersonManager implements Manager {
@In StatusMessages statusMessages;
@In
Person person;
public void confirm() {
statusMessages.add("Confirm New firstName: " + person.getFirstName());
}
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
@Remove
public void destroy(){};
}