本文整理汇总了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;
}
}