XForms/URL Rewriter


You want a nice easy-to-use form to configure and test URL rewriting rules that can be use with the Jetty web server.

Here is the overall structure of the Jetty configuration file:

<Configure id="Server" class="org.mortbay.jetty.Server">
   <Get id="oldhandler" name="handler"/>
   <Set name="handler">
      <New id="Rewrite" class="org.mortbay.jetty.handler.rewrite.RewriteHandler">

         <!-- redirect an entire directory of content -->
         <Call name="addRewriteRule">

         <!-- redirect an entire directory of content -->
         <Call name="addRewriteRule">

         <!-- add a regex rule -->
         <Call name="addRule">
               <New class="org.mortbay.jetty.handler.rewrite.RewriteRegexRule">
                  <Set name="regex">/test/dump/regex/([^/]*)/(.*)</Set>
                  <Set name="replacement">/test/dump/$2/$1</Set>


You will not that their are two blocks of repeating elements. One for addRule and one for addRewriteRule. Our XForms application with have two repeating structures, one for each of these rules.

Structure of the formEdit

Our form will have a single line for each rewrite rule. When you click on that rule it will display an inspector below that has a type-sensitive editor for that rule. Under the rule there will be a button to test the rule by sending the rule to a regex test server. This will run the rule on the input test cases and return the results.


Next Page: Web Service Tester | Previous Page: Dashboard Builder

Home: XForms