Package javax.faces.context

Examples of javax.faces.context.ExternalContext.encodeNamespace()


  // Implement the method that satisfies NamingContainer

  public static String getContainerClientId(FacesContext context, String additionalId)
  {
    ExternalContext ec = context.getExternalContext();
    String namespace = ec.encodeNamespace(SEPARATOR);

    /*
     * In servlet world encodeNamespace does nothing -- so if we get back what we sent in then do
     * not perturn the NamingContainer Id
     */
 
View Full Code Here


    public String createUniqueId()
    {
        ExternalContext extCtx = FacesContext.getCurrentInstance()
                .getExternalContext();
        StringBuilder bld = __getSharedStringBuilder();
        return extCtx.encodeNamespace(bld.append(UNIQUE_ID_PREFIX).append(
                _uniqueIdCounter++).toString());
    }

    /**
     * The locale for this view.
View Full Code Here

    } else if (implicitQueue != null) {
      options.put("implicitEventsQueue", clientId);
    }

    ExternalContext externalContext = facesContext.getExternalContext();
    String namespace = externalContext.encodeNamespace("");
    if (namespace != null && namespace.length() != 0) {
      options.put("namespace", namespace);
    }
   
    String similarityGroupingId = (String) componentAttributes.get(SIMILARITY_GROUPING_ID_ATTR);
View Full Code Here

   
    String similarityGroupingId = (String) componentAttributes.get(SIMILARITY_GROUPING_ID_ATTR);
    if (similarityGroupingId == null || similarityGroupingId.length() == 0) {
      similarityGroupingId = clientId;
    } else {
      similarityGroupingId = externalContext.encodeNamespace(similarityGroupingId);
    }
   
    options.put(SIMILARITY_GROUPING_ID_ATTR, similarityGroupingId);

    // request timeout.
View Full Code Here

     * Provides a unique id for this component instance.
     */
    public String createUniqueId()
    {
        ExternalContext extCtx = FacesContext.getCurrentInstance().getExternalContext();
        return extCtx.encodeNamespace(UNIQUE_ID_PREFIX + _uniqueIdCounter++);
    }

    /**
     * Gets The locale for this ViewRoot.
     *
 
View Full Code Here

        // (At which point the self restore overwrites any id set prior.).  As this manual
        // set is using the already encoded (saved) value we could end up with a doubly
        // encoded id until the restore overwrites.  To avoid this -- first test if
        // its already encoded and don't re-encode.
        ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
        id = PORTLET_NAMESPACE_ID_PREFIX + ec.encodeNamespace("") + "_" + id;
      }
    
    }
    super.setId(id);
  }
View Full Code Here

            lCurrentCounter++;

            context.getExternalContext().getRequestMap().put(UNIQUE_ID_COUNTER_ATTR,new Long(lCurrentCounter));

            ExternalContext extCtx = FacesContext.getCurrentInstance().getExternalContext();
            return extCtx.encodeNamespace(retValue.toString());
        }
    }

    /**
     * Create a UIComponent. Abstract method getComponentType is invoked to
View Full Code Here

     *  Provides a unique id for this component instance.
     */
    public String createUniqueId()
    {
        ExternalContext extCtx = FacesContext.getCurrentInstance().getExternalContext();
        return extCtx.encodeNamespace(UNIQUE_ID_PREFIX + _uniqueIdCounter++);
    }

    /**
     * The locale of this view.  Default: the default locale from the configuration file.
     *
 
View Full Code Here

     *  Provides a unique id for this component instance.
     */
    public String createUniqueId()
    {
        ExternalContext extCtx = getFacesContext().getExternalContext();
        return extCtx.encodeNamespace(UNIQUE_ID_PREFIX + _uniqueIdCounter++);
    }

    /**
     * The locale of this view.  Default: the default locale from the configuration file.
     *
 
View Full Code Here

            lCurrentCounter++;

            context.getExternalContext().getRequestMap().put(UNIQUE_ID_COUNTER_ATTR,new Long(lCurrentCounter));

            ExternalContext extCtx = FacesContext.getCurrentInstance().getExternalContext();
            return extCtx.encodeNamespace(retValue.toString());
        }
    }

    /**
     * Create a UIComponent. Abstract method getComponentType is invoked to
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.