本文整理匯總了Java中javax.el.ValueExpression.getExpressionString方法的典型用法代碼示例。如果您正苦於以下問題:Java ValueExpression.getExpressionString方法的具體用法?Java ValueExpression.getExpressionString怎麽用?Java ValueExpression.getExpressionString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.el.ValueExpression
的用法示例。
在下文中一共展示了ValueExpression.getExpressionString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processAction
import javax.el.ValueExpression; //導入方法依賴的package包/類
/**
* Gets the value from the "from" property and sets it on
* the ValueBinding for the "to" property
*/
public void processAction(ActionEvent event)
{
ValueExpression to = _bean.getValueExpression(Bean.TO_KEY);
if (to != null)
{
Object from = getFrom();
try
{
to.setValue(FacesContext.getCurrentInstance().getELContext(), from);
}
catch (RuntimeException e)
{
if (_LOG.isWarning())
{
ValueExpression fromExpression = _bean.getValueExpression(Bean.FROM_KEY);
String mes = "Error setting:'"+to.getExpressionString() +
"' to value:"+from;
if (fromExpression != null)
mes += " from:'"+fromExpression.getExpressionString()+"'";
_LOG.warning(mes, e);
}
throw e;
}
}
}
示例2: resolveStaticField
import javax.el.ValueExpression; //導入方法依賴的package包/類
public String resolveStaticField(ValueExpression expression) {
if (expression != null) {
String expressionString = expression.getExpressionString();
expressionString = expressionString.substring(2, expressionString.length() - 1); // Remove #{}
return expressionString.substring(expressionString.indexOf(".") + 1); // Remove var
}
else {
return null;
}
}