Examples of UrlMatchCondition


Examples of net.sourceforge.urlrewriter4j.core.conditions.UrlMatchCondition

   * @see net.urlrewriter.parsers.IRewriteConditionParser#parse(org.w3c.dom.Node)
   */
  public IRewriteCondition parse(Node pNode) throws ConfigurationException {
    Node oMatchNode = pNode.getAttributes().getNamedItem(Constants.ATTR_URL);
    if (oMatchNode != null) {
      return new UrlMatchCondition(oMatchNode.getNodeValue());
    }
    return null;
  }
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.conditions.UrlMatchCondition

    //rule.setFrom("^/([a-z]+)/([0-9]+)/" + i + "/$");
      // rule.setTo("/blah/a/$2/");   
    for (int i = 0; i < 1000; i++) {
      RewriteAction oRewriteAction = new RewriteAction("/blah/a/$2/", RewriteProcessing.StopProcessing); // RewriteProcessing.StopProcessing);
      ConditionalAction oAction = new ConditionalAction();
      oAction.getConditions().add(new UrlMatchCondition("^/([a-z]+)/([0-9]+)/" + i + "/$"));
      oAction.getActions().add(oRewriteAction);
      oConfiguration.getRules().add(oAction);
    }   
    final RewriterEngine oEngine = new RewriterEngine(oConfiguration);
    final MockContextFacade oMockFacade = new MockContextFacade("http://localhost/dir/999/45/");
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.conditions.UrlMatchCondition

  public void testUrlMatchConditionPositive() throws Exception {
    RewriterConfiguration oConfiguration = getConfig();

    ConditionalAction oAction = new ConditionalAction();
    oAction.getConditions().add(new UrlMatchCondition("/test.aspx"));
    oAction.getActions().add(new NotImplementedAction());

    oConfiguration.getRules().add(oAction);

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.conditions.UrlMatchCondition

  public void testUrlMatchConditionNegative() throws Exception {
    RewriterConfiguration oConfiguration = getConfig();

    ConditionalAction oAction = new ConditionalAction();
    oAction.getConditions().add(new UrlMatchCondition("/foo1.aspx"));
    oAction.getActions().add(new NotImplementedAction());

    oConfiguration.getRules().add(oAction);

    MockContextFacade oMockFacade = new MockContextFacade("/", ".",
View Full Code Here

Examples of net.sourceforge.urlrewriter4j.core.conditions.UrlMatchCondition

  }

  private ConditionalAction createUrlConditionAndRewirteAction(String pRewriteLocation, String pUrlPattern) {
    RewriteAction oRewriteAction = new RewriteAction(pRewriteLocation, RewriteProcessing.StopProcessing);
    ConditionalAction oAction = new ConditionalAction();
    oAction.getConditions().add(new UrlMatchCondition(pUrlPattern));
    oAction.getActions().add(oRewriteAction);
    return oAction;
  }
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.