Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

JSF and JSTL

Thread view: 
beatdown - 26 Jun 2006 17:12 GMT
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"/>
...
<h:outputText 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>
...
Moiristo - 26 Jun 2006 17:38 GMT
> 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
[quoted text clipped - 5 lines]
> JSTL tag... Has JSF any tag for do this? What can I do?
> Thank you very much.

Maybe you can use the 'rendered' attribute?
beatdown - 26 Jun 2006 17:48 GMT
How? What I need, is accessing in some way to the bean attributes to
perform a comparision.

Moiristo ha escrito:

> > 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
[quoted text clipped - 7 lines]
>
> Maybe you can use the 'rendered' attribute?
Danno - 26 Jun 2006 18:25 GMT
> How? What I need, is accessing in some way to the bean attributes to
> perform a comparision.
[quoted text clipped - 12 lines]
> >
> > Maybe you can use the 'rendered' attribute?

<h:inputText id="edad" value="#{personBean.edad}"
rendered="#{personBean.masDe18}"/>


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.