开发者

JSF multiple @ViewScoped and @ManagedBeans on same page results in null injection

开发者 https://www.devze.com 2023-04-09 03:22 出处:网络
I have two classes as follows: @ManagedBean( name = \"randomBar\") @ViewScoped public class Soap { private List<Cat> cats;

I have two classes as follows:

@ManagedBean( name = "randomBar")  
@ViewScoped  
public class Soap  
{  
   private List<Cat> cats;  
   //getter/setter pair  
}  


@ManagedBean ( name = "marioPaint")  
@ViewScoped  
public class House  
{  
   @ManagedProperty(value= "#{randomBar}")  
   private Soap开发者_如何学Go soap  
   //getter/setter pair
...

public void printCatInformation()
{
   System.out.println(soap.getCats()); //null  
 }  

These are both on the same page. The Soap object is able to print to console it's size while House is unable to get anything beyond a null pointer. My question is how do I send that information back to the instance of Soap that is present inside of House?

Update: This is running on Oracle 10.3.4 with Icefaces 2.0 (Mojarra).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号