title: java play framework 2.1.3 How retrive a routes object
body: <p>i would like to know how is possible retrive a route object from a string in the global.java class because im trying to make a dynamic module routing: i don't want to edit my 
  main routes each time i add a module (sub-project) as</p>
  
  <p>-> /mymodule  mymodule.Routes</p>
  
  <p>So to avoid this,i'm tring to load the target routes depending of the URI path.
  /module/mymodule  </p>
  
  <p>I tryed to write some code as follow inside onRouteRequest()</p>
  
  <pre><code>Class.forName("mymodule.Routes").routes.lift(request);
  </code></pre>
  
  <p>but it fail, any suggestions?</p>
  
  <p><strong>edit 1</strong>: in play 1 was possible something like that:  </p>
  
  <pre><code>/{controller}/{action} {controller}.{action}
  </code></pre>
  
  <p>But in play2 seems dont work as well</p>
  
  <p><strong>edit 2</strong>: my current Global.java is </p>
  
  <pre><code>import play.GlobalSettings;
  import play.Play;
  import play.api.mvc.Handler;
  import play.mvc.Http;
  
  public class Global extends GlobalSettings
  {
  
  @Override
  public Handler onRouteRequest(Http.RequestHeader request)
  {
      String path = request.path();
      if (path.startsWith("/module/"))
      {
          String[] paths = path.split("/");
          String router = paths[2];
          try
          {
              return (Handler) Class.forName(router + ".Routes", true, Play.application().classloader()).newInstance();
          }
          catch (InstantiationException | IllegalAccessException | ClassNotFoundException e)
          {
              e.printStackTrace();
          }
      }
      return super.onRouteRequest(request);
  }
  }
  </code></pre>
  
  <p>And he found the correct routes but Instantation Exception is thrown</p>