title: Error in .txt Play! template, works as .xml
body: <p>I'm running into a really strange error in one simple txt template. There is no error when I serve it as XML, so the error has nothing to do with the template itself, nor the involved routes. Is this a bug in Play! (I'm using 1.2.4)?</p>
  
  <p>This is the error message when requesting /robots.txt:</p>
  
  <pre><code>No route found 
  No route able to invoke action PublicController.sitemap with arguments {} was found.
  
  ----------
  In /app/views/PublicController/robots.txt (around line 1)
  
  &gt; 1: Sitemap: @@{PublicController.sitemap()}
  
  This exception has been logged with id 69kj6fdbk
  </code></pre>
  
  <p>This is the template of robots.txt:</p>
  
  <pre><code>Sitemap: @@{PublicController.sitemap()}
  </code></pre>
  
  <p>This is the associated route:</p>
  
  <pre><code>GET    /robots.txt    PublicController.robots(format:'txt')
  GET    /sitemap.xml   PublicController.sitemap(format:'xml')
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Ok, this seems to be a bug in Play! I found the following in <code>ActionDefinition Router.reverse(String, Map&lt;String, Object&gt;)</code> from line 461:</p>
  
  <pre><code>if (!(Http.Request.current() == null ? "" : Http.Request.current().format).equals(route.staticArgs.get("format"))) {
      allRequiredArgsAreHere = false;
      break;
  }
  continue;
  </code></pre>
  
  <p>where the <code>break</code> leads to a <code>NoRouteFoundException</code>. I don't see why the request format must be checked during reverse routing. Reverse routing is used to generate links, and not responses or anything similar. Maybe this may have side effects on redirects, because <code>Controller.redirect(String, boolean, Object...)</code> uses <code>reverse</code> and may rely on this behaviour (does a HTTP redirect even allow content-type or format?). Anyway, the main Play! tests pass in my play fork.</p>
  
  <p>I filed a bug report <a href="https://play.lighthouseapp.com/projects/57987-play-framework/tickets/1467" rel="nofollow">here</a>.</p>