1 5 package com.opensymphony.webwork.views.jsp.ui; 6 7 import com.opensymphony.xwork.util.OgnlUtil; 8 import ognl.Ognl; 9 import ognl.OgnlException; 10 11 12 16 public class OgnlTool { 17 19 private static OgnlTool instance = new OgnlTool(); 20 21 23 private OgnlTool() { 24 } 25 26 28 public static OgnlTool getInstance() { 29 return instance; 30 } 31 32 public Object findValue(String expr, Object context) { 33 try { 34 return Ognl.getValue(OgnlUtil.compile(expr), context); 35 } catch (OgnlException e) { 36 return null; 37 } 38 } 39 } 40 | Popular Tags |