B
beatdown
Hi all, I'm new in JSF and I'm making my first test applications.
As you can see below, I have a bean named personBean who has an
attribute (edad). The attribute is an int at the backend bean. My
question is:
How could I compare this int with another int value and then show a
message refered to the result of that comparision? I've thought about
usgin JSTL (<c:if ...>) but I don't know how to access that bean in a
JSTL tag... Has JSF any tag for do this? What can I do?
Thank you very much.
page.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:loadBundle basename="bundle.messages" var="msg"/>
....
<hutputText value="#{personBean.edad}" />
....
faces-config.xml
....
<managed-bean>
<managed-bean-name>personBean</managed-bean-name>
<managed-bean-class>jsfHello.PersonBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
....
As you can see below, I have a bean named personBean who has an
attribute (edad). The attribute is an int at the backend bean. My
question is:
How could I compare this int with another int value and then show a
message refered to the result of that comparision? I've thought about
usgin JSTL (<c:if ...>) but I don't know how to access that bean in a
JSTL tag... Has JSF any tag for do this? What can I do?
Thank you very much.
page.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:loadBundle basename="bundle.messages" var="msg"/>
....
<hutputText value="#{personBean.edad}" />
....
faces-config.xml
....
<managed-bean>
<managed-bean-name>personBean</managed-bean-name>
<managed-bean-class>jsfHello.PersonBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
....