This content has been marked as final. 
    
Show                 6 replies
    
- 
        1. Re: JSFServerSession getManagedBeanValue() and Bean Construcssilvert Dec 10, 2008 10:54 PM (in response to szgaljic)This looks odd: MyBean bean = (MyBean)jsfServer.getManagedBeanValue("myBean");
 It have an EL expression:MyBean bean = (MyBean)jsfServer.getManagedBeanValue("#{myBean"");
 But the really odd part is that you wouldn't get an ELException from that.
 So assuming that your code is actually correct and it really did return an instance of MyBean, I'm not sure what could be happening.
 You might want to look at this bug which would come into play if the bean was never referenced in your application code: https://jira.jboss.org/jira/browse/JSFUNIT-164
 One question I have is, which JSF implementation and platform are you using? And more specifically, do you know the EL implementation?
 Stan
- 
        2. Re: JSFServerSession getManagedBeanValue() and Bean Construcszgaljic Dec 10, 2008 10:58 PM (in response to szgaljic)Opss!!! You're right sorry that was a typo I really did mean to type MyBean bean = (MyBean)jsfServer.getManagedBeanValue("myBean");
 And yes I do know EL expression language. I'll look into that bug URL you just sent. If you're interested, try it out for yourself, I'm curious if others experience the same.
 Env...
 Tomcat v6.0
 jboss-jsfunit-core-1.0.0.Beta3.jar
 JRE 1.6.0_07
- 
        3. Re: JSFServerSession getManagedBeanValue() and Bean Construcssilvert Dec 11, 2008 7:19 AM (in response to szgaljic)What version of JSF are you using? 
 Stan
- 
        4. Re: JSFServerSession getManagedBeanValue() and Bean Construcszgaljic Dec 11, 2008 8:46 AM (in response to szgaljic)I can't believe I wrote another typo, this post is going down the drain fast. 
 MyBean bean = (MyBean)jsfServer.getManagedBeanValue("#{myBean}");
 I am using JSF 1.2
- 
        5. Re: JSFServerSession getManagedBeanValue() and Bean Construcssilvert Dec 11, 2008 4:25 PM (in response to szgaljic)I can't recreate your problem. Can you send me a simple WAR that demonstrates it? 
 Also, can you try changing MyBean to look like this:package com.example; public class MyBean{ public int random = -1; public MyBean(){ // guaranteed to generate a number greater than 0 random = 1; System.out.println("MyBean constructed, random="+random); } }
- 
        6. Re: JSFServerSession getManagedBeanValue() and Bean Construcszgaljic Dec 12, 2008 12:49 AM (in response to szgaljic)Stan, 
 I'm sorry, I have no idea what has changed but I can't recreate this now. Its working fine now. If it happens again I'll be sure to bring it up. Thank you for your patience.
 Steven
 
    