Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

25.2. Usage

Parameters are surrounded by parentheses, and separated by commas:
<h:commandButton action="#{hotelBooking.bookHotel(hotel, user)}" value="Book Hotel"/>
The parameters hotel and user will be evaluated as value expressions and passed to the bookHotel() method of the component. This gives you an alternative to the use of @In.
Any value expression may be used as a parameter:
<h:commandButton action="#{hotelBooking.bookHotel(hotel.id, user.username)}" value="Book Hotel"/>
You may even pass literal strings using single or double quotes:
<h:commandLink action=”#{printer.println( ‘Hello world!’ )}” value=”Hello”/>
<h:commandLink action=’#{printer.println( “Hello again” )}’ value=’Hello’/>
You might even want to use this notation for all your action methods, even when you don’t have parameters to pass. This improves readability by making it clear that the expression is a method expression and not a value expression:
<s:link value="Cancel" action="#{hotelBooking.cancel()}"/>

 
 
  Published under the terms of the Open Publication License Design by Interspire