Example #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;
  }
Example #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);
   }
 }
Example #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;
  }
Example #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;
  }
Example #5
0
 /** @see java.util.HashMap#isEmpty() */
 @Override
 public boolean isEmpty() {
   return super.isEmpty() && (parent == null || parent.isEmpty());
 }