Package javax.faces.context

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


        // cause problems if the ViewHandler is wrapped
        String actionEncodedViewId = getViewHandler(context).getActionURL(context, viewId);
       
        ExternalContext externalContext = context.getExternalContext();
        String redirectEncodedURL = externalContext.encodeRedirectURL(actionEncodedViewId, viewParameters);
        return externalContext.encodeActionURL(redirectEncodedURL);
    }

    @Override
    public ViewDeclarationLanguage getViewDeclarationLanguage(
            FacesContext context, String viewId)
View Full Code Here


    final String POUNDCHAR_TEST_STRING = "#AnchorReference";
    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();
   
    if (extCtx.encodeActionURL(POUNDCHAR_TEST_STRING).equals(POUNDCHAR_TEST_STRING))
    {
      testRunner.setTestResult(true,
                               "encodeActionURL correctly returned an unchanged string when the string was prefixed with #.");
      return Constants.TEST_SUCCESS;
    }
View Full Code Here

    {
      testRunner.setTestResult(false,
                               "encodeActionURL didn't return an unchanged string when the string was prefixed with #.  Test parameter: " +
                               POUNDCHAR_TEST_STRING +
                               " and encodeActionURL returned: " +
                               extCtx.encodeActionURL(POUNDCHAR_TEST_STRING));
      return Constants.TEST_FAILED;
    }
  }

  // Test is SingleRequest -- Render only
View Full Code Here

    final String ABSOLUTEURL_TEST_STRING = "http://www.apache.org";
    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();
   
    if (extCtx.encodeActionURL(ABSOLUTEURL_TEST_STRING).equals(ABSOLUTEURL_TEST_STRING))
    {
      testRunner.setTestResult(true,
                               "encodeActionURL correctly returned an unchanged string when passed an absolute URL.");
      return Constants.TEST_SUCCESS;
    }
View Full Code Here

    {
      testRunner.setTestResult(false,
                               "encodeActionURL didn't return an unchanged string when passed an absolute URL.  Test parameter: " +
                               ABSOLUTEURL_TEST_STRING +
                               " and encodeActionURL returned: " +
                               extCtx.encodeActionURL(ABSOLUTEURL_TEST_STRING));
      return Constants.TEST_FAILED;
    }
  }

  // Test is SingleRequest -- Render only
View Full Code Here

                 .append(":")
                 .append(r.getServerPort())
                 .append(DIRECTLINK_TRUE_TEST_STRING)
                 .toString();
   
    if (extCtx.encodeActionURL(DIRECTLINK_TRUE_TEST_STRING).equalsIgnoreCase(s))
    {
      testRunner.setTestResult(true,
                               "encodeActionURL correctly returned an absolute URL representing the DirectLink url and it correctly contains the javax.portlet.faces.DirectLink parameter with a value of true.");
      return Constants.TEST_SUCCESS;
    }
View Full Code Here

    {
      testRunner.setTestResult(false,
                               "encodeActionURL didn't return an absolute URL representing the DirectLink url or it didn't contain the javax.portlet.faces.DirectLink parameter with a value of true.  Expected: " +
                               s +
                               " and encodeActionURL returned: " +
                               extCtx.encodeActionURL(DIRECTLINK_TRUE_TEST_STRING));
      return Constants.TEST_FAILED;
    }
  }

  // Test is SingleRequest -- Render only
View Full Code Here

    final String DIRECTLINK_FALSE_TEST_STRING =
      "/test.jsp?firstParam=value&javax.portlet.faces.DirectLink=false&anotherParam=value";
    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();
   
    if (!extCtx.encodeActionURL(DIRECTLINK_FALSE_TEST_STRING).contains("javax.portlet.faces.DirectLink"))
    {
      testRunner.setTestResult(true,
                               "encodeActionURL correctly returned an url string without the javax.portlet.faces.DirectLink parameter when its value was false.");
      return Constants.TEST_SUCCESS;
    }
View Full Code Here

    {
      testRunner.setTestResult(false,
                               "encodeActionURL didn't return an url string without the javax.portlet.faces.DirectLink parameter when its value was false.  Test parameter: " +
                               DIRECTLINK_FALSE_TEST_STRING +
                               " and encodeActionURL returned: " +
                               extCtx.encodeActionURL(DIRECTLINK_FALSE_TEST_STRING));
      return Constants.TEST_FAILED;
    }
  }

  // Test is SingleRequest -- Render only
View Full Code Here

    // with the same encoding as compare string.
    String bridgeEncoded = null;
    if (isStrictXhtmlEncoded(portletEncoded))
    {
      bridgeEncoded =
        extCtx.encodeActionURL(PORTLET_RENDER_TEST_STRING_XMLENCODED);
    }
    else
    {
      bridgeEncoded =
        extCtx.encodeActionURL(PORTLET_RENDER_TEST_STRING);
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.