[OmniFaces utilities] The
resolveExpressionSet() method programmatically EL-resolve the given property on the given base object and set the given value.Method:
See also: Faces#getContext()
Usage:
Let's
suppose that we have the following simple bean:
@Named
@SessionScoped
public class
CommandBean {
 private String command;
 private String process;
 public String getProcess() {
  return
process;
 }
 public void setProcess(String process) {
  this.process = process;
 }       
 public String getCommand() {
  return
command;
 }
 public void setCommand(String command) {
  this.command = command;
 }
}
Now, for
an instance of CommandBean, we can set the command as /f /pid 8080 and the process as taskkill via the Faces#resolveExpressionSet():
CommandBean
commandBean = new CommandBean();
Faces.resolveExpressionSet(commandBean,
"command", "/f /pid 8080");
Faces.resolveExpressionSet(commandBean,
"process", "taskkill");
We can easily
perform a check via Faces#resolveExpressionGet():
// returns /f
/pid 8080
String
command = Faces.resolveExpressionGet(commandBean, "command");
// returns taskkill
String
process = Faces.resolveExpressionGet(commandBean, "process");





 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 Ajax
Ajax Beans
Beans Callbacks
Callbacks Components
Components Events
Events Exceptions
Exceptions Faces
Faces Facelets
Facelets JSON
JSON Hacks
Hacks State
State     JNDI
JNDI Platform
Platform Utils
Utils Messages
Messages MapWrapper
MapWrapper Reflection
Reflection Renderers
Renderers ResourcePaths
ResourcePaths XML
XML Servlets
Servlets
 
 <h:inputText/>
<h:inputText/>          ZEEF JSF Beginner's Guide
ZEEF JSF Beginner's Guide       JSF 2 Tutorials at www.mkyong.com
JSF 2 Tutorials at www.mkyong.com      JavaServer Faces (JSF) Tutorial
JavaServer Faces (JSF) Tutorial      

















 
 Postări
Postări
 
 
Niciun comentariu :
Trimiteți un comentariu