1 28 29 package com.caucho.jsp.el; 30 31 import com.caucho.el.AbstractVariableResolver; 32 33 import javax.el.ELContext; 34 import javax.el.ELException; 35 import javax.el.ELResolver; 36 import javax.servlet.jsp.el.VariableResolver ; 37 38 41 public class ELContextAdapter extends ELContext { 42 private VariableResolver _resolver; 43 private ELResolver _elResolver = new ELResolverAdapter(); 44 45 48 ELContextAdapter(VariableResolver resolver) 49 { 50 _resolver = resolver; 51 } 52 53 public ELResolver getELResolver() 54 { 55 return _elResolver; 56 } 57 58 public javax.el.FunctionMapper getFunctionMapper() 59 { 60 return null; 61 } 62 63 public javax.el.VariableMapper getVariableMapper() 64 { 65 return null; 66 } 67 68 class ELResolverAdapter extends AbstractVariableResolver 69 { 70 @Override 71 public Object getValue(ELContext context, Object base, Object property) 72 { 73 if (base == null && property instanceof String ) { 74 if (context != null) 75 context.setPropertyResolved(true); 76 77 try { 78 return _resolver.resolveVariable((String ) property); 79 } catch (Exception e) { 80 throw new ELException(e); 81 } 82 } 83 else 84 return null; 85 } 86 87 } 88 } 89 | Popular Tags |