Package javax.faces.context

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


    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();
    RenderResponse response = (RenderResponse) extCtx.getResponse();

    String encodedNamespace = extCtx.encodeNamespace("");
    if (encodedNamespace == null)
    {
      testRunner.setTestResult(false,
                               "extCtx.encodeNamespace() failed:  it returned a null value");
    }
View Full Code Here


    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();
    RenderResponse response = (RenderResponse) extCtx.getResponse();

    String encodedNamespace = extCtx.encodeNamespace("");
    if (encodedNamespace == null)
    {
      testRunner.setTestResult(false,
                               "extCtx.encodeNamespace() failed:  it returned a null value");
    }
View Full Code Here

        uniqueIdCounter = (uniqueIdCounter == null) ? 0 : uniqueIdCounter;
        getStateHelper().put(PropertyKeys.uniqueIdCounter, (uniqueIdCounter+1L));
        // Generate an identifier for a component. The identifier will be prefixed with UNIQUE_ID_PREFIX, and will be unique within this UIViewRoot.
        if(seed==null)
        {
            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(uniqueIdCounter).toString());   
        }
        // Optionally, a unique seed value can be supplied by component creators which should be included in the generated unique id.
        else
        {
            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(seed).toString());
View Full Code Here

            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(uniqueIdCounter).toString());   
        }
        // Optionally, a unique seed value can be supplied by component creators which should be included in the generated unique id.
        else
        {
            return extCtx.encodeNamespace(bld.append(UIViewRoot.UNIQUE_ID_PREFIX).append(seed).toString());
        }
    }

    /**
     * Perform necessary actions when rendering of this component starts, before delegating to the inherited
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());
    }

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

*                   * that prefer not to subclass <code>PortletNamingContainerUIViewRoot</code>
*                      */
  public static String convertClientId(FacesContext context, UIViewRoot root, 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

   * that prefer not to subclass <code>PortletNamingContainerUIViewRoot</code>
   */
  public static String convertClientId(FacesContext context, UIViewRoot root, 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 class PortletAjaxViewRootRenderer extends AjaxViewRootRenderer {

    protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        ExternalContext externalContext = context.getExternalContext();
    Object namespace = externalContext.encodeNamespace("");
        AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
        Map<String, Object> requestMap = externalContext.getRequestMap();
        if(requestMap.containsKey("javax.servlet.error.exception")||requestMap.containsKey("javax.servlet.error.status_code")){
          // All error pages rendered as non-ajax.
          ajaxContext.setAjaxRequest(false);
View Full Code Here

    * implementations that prefer not to subclass <code>PortletNamingContainerUIViewRoot</code>
    */
   public static String convertClientId(FacesContext context, UIViewRoot root, 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

         // 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.
         Boolean encoded;
         ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
         id = ec.encodeNamespace(PREFIX + id);
         // now indicate that this id is encoded
         encoded = Boolean.TRUE;
         getAttributes().put(SEPARATOR, encoded);
      }
      super.setId(id);
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.