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 );
}