Ejemplo n.º 1
0
  /**
   * @param context
   * @return
   */
  protected ExpressionContext createELContext(FacesContext context) {
    ExpressionContext elContext = new ExpressionContext();

    elContext.put("FS", File.separator);

    elContext.put("userHome", System.getProperty("user.dir"));
    elContext.put("appHome", applicationHome.getPath());

    ServletContext servletContext = (ServletContext) context.getExternalContext().getContext();
    String webRoot = servletContext.getRealPath("/WEB-INF");

    if (webRoot != null) {
      elContext.put("webRoot", webRoot);
    }

    return elContext;
  }
Ejemplo n.º 2
0
 /** @see java.util.HashMap#containsKey(java.lang.Object) */
 @Override
 public boolean containsKey(Object key) {
   if (super.containsKey(key)) {
     return true;
   } else {
     return parent != null && parent.containsKey(key);
   }
 }
Ejemplo n.º 3
0
  /** @see java.util.HashMap#get(java.lang.Object) */
  @Override
  public Object get(Object key) {
    Object value = null;

    if (super.containsKey(key)) {
      value = super.get(key);
    } else if (parent != null) {
      value = parent.get(key);
    }

    if (value instanceof ValueBinding) {
      value = ((ValueBinding<?>) value).getValue();
    }

    return value;
  }
Ejemplo n.º 4
0
  /** @see java.util.HashMap#keySet() */
  @Override
  public Set<String> keySet() {
    Set<String> keySet = super.keySet();

    if (parent != null) {
      keySet = new HashSet<String>(keySet);

      Set<String> parentSet = parent.keySet();

      for (String key : parentSet) {
        if (!keySet.contains(key)) {
          keySet.add(key);
        }
      }
    }

    return keySet;
  }
Ejemplo n.º 5
0
 /** @see java.util.HashMap#isEmpty() */
 @Override
 public boolean isEmpty() {
   return super.isEmpty() && (parent == null || parent.isEmpty());
 }