You must be defined your managed bean into your faces-config.xml
 
Like this:
 

<managed-bean>

<managed-bean-name>testBean</managed-bean-name>

         <managed-bean-class>

                com.mypackage.TestBean

      </managed-bean-class>

<managed-bean-scope>session</managed-bean-scope>

</managed-bean>

 
And in your jsp:
 
<outputText value="Here I am" rendered="#{testBean.renderMe}" />
 
And in your Bean:

public class TestBean {

    int i = 0;

    public boolean isRenderMe() {
        if( i%2 == 0 ) return true;
        else return false;
    }
}

Try ! :)

--
Mariano G. Petrakovsky
Programmer · Software Factory
AXG Tecnonexo -  www.tecnonexo.com

Development facilities:Av. Maipú 1252 8º (C1006ACT) · Buenos Aires · Argentina.
Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065.

Headquarters: 1604 Spring Hill Road, Suite 160 Vienna · VA 22182 · USA.
Tel.: (202) 986-7541 - Fax: (202) 787-3891.


· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
 

-----Mensaje original-----
De: Elam Daly [mailto:[EMAIL PROTECTED]
Enviado el: Lunes, 21 de Noviembre de 2005 12:53
Para: [email protected]
Asunto: Rendered Property: Simple Test ( Try Again! )

Howdy all,

I'm trying to do something very simple.  I have an <outputText> component set as  <outputText value="Here I am" rendered="#{TestBean.renderMe}" />

The TestBean is simple as well:

public class TestBean {

    int i = 0;

    public boolean renderMe() {
        if( i%2 == 0 ) return true;
        else return false;
    }
}

I'm just trying to set the render state programmaticly, yet Tomcat keeps throwing this:
javax.faces.FacesException: Bean: com.whiteware.beans.TestBean, property: rendStatus
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
(JspViewHandlerImpl.java:234)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter
(ExtensionsFilter.java:123)
In fact, if I try to use any bean method at all, it always fails.  Even something as simple as 'return true' etc.

Any help would be appreciated,
Elam

Reply via email to