Package javax.faces.context

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


      testRunner.setTestResult(false,
                               "EncodeActionURL incorrectly returned an url including xml escaping when the input url wasn't escaped.");
      return Constants.TEST_FAILED;
    }
   
    if (!isStrictXhtmlEncoded(extCtx.encodeActionURL("/tests/SingleRequestTest.jsp?parm1=a&param2=b")))
    {
      testRunner.setTestResult(false,
                               "EncodeActionURL incorrectly returned an url without xml escaping when the input url was escaped.");
      return Constants.TEST_FAILED;
    }
View Full Code Here


      testRunner.setTestResult(false,
                               "EncodeActionURL incorrectly returned an url without xml escaping when the input url was escaped.");
      return Constants.TEST_FAILED;
    }
   
    if (isStrictXhtmlEncoded(extCtx.encodeActionURL("/tests/SingleRequestTest.jsp")))
    {
      testRunner.setTestResult(false,
                               "EncodeActionURL incorrectly returned an url including xml escaping when the input url contained no indication (no query string).");
      return Constants.TEST_FAILED;
    }
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

    final String DIRECTLINK_TRUE_TEST_STRING =
      "/test.jsp?firstParam=value&javax.portlet.faces.DirectLink=true&anotherParam=value";
    FacesContext ctx = FacesContext.getCurrentInstance();
    ExternalContext extCtx = ctx.getExternalContext();
   
    if (extCtx.encodeActionURL(DIRECTLINK_TRUE_TEST_STRING).equals(DIRECTLINK_TRUE_TEST_STRING))
    {
      testRunner.setTestResult(true,
                               "encodeActionURL correctly returned an unchanged string when passed an URL containing 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 unchanged string when passed an URL containing the javax.portlet.faces.DirectLink parameter with a value of true.  Test parameter: " +
                               DIRECTLINK_TRUE_TEST_STRING +
                               " 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

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.