Package com.dotcms.repackage.org.tuckey.web.filters.urlrewrite

Examples of com.dotcms.repackage.org.tuckey.web.filters.urlrewrite.NormalRule


     * @throws Exception
     */
    protected void addRewriteRule ( String from, String to, String type, String name ) throws Exception {

        //Create the tuckey rule
        NormalRule rule = new NormalRule();
        rule.setFrom( from );
        rule.setToType( type );
        rule.setTo( to );
        rule.setName( name );

        //And add the rewrite rule
        addRewriteRule( rule );
    }
View Full Code Here


         2) Creating a tuckey Rule,what this rule do can be easily accomplish by using the "addRewriteRule"
         but what make it is different the Condition we added to the rule, that condition specifies that the
         rule is not going to be execute it unless we are using a chrome browser.
          */
        //Creating a tuckey rule
        NormalRule forwardRule = new NormalRule();
        forwardRule.setFrom( "^/example/url/condition/$" );
        forwardRule.setToType( "forward" );
        forwardRule.setTo( "/app/helloworld?browser=chrome" );
        forwardRule.setName( "ExampleTuckeyCondition" );
        //Create a Condition for this rule
        Condition condition = new Condition();
        condition.setName( "user-agent" );
        condition.setValue( "Chrome/*.*" );
        forwardRule.addCondition( condition );

        //Register the tuckey rewrite rule
        addRewriteRule( forwardRule );
    }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.tuckey.web.filters.urlrewrite.NormalRule

Copyright © 2018 www.massapicom. 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.