title: configure jetty to download file instead of opening a new tab
body: <p>I'm searching for a solutions / configuration which forces jetty to download linked files instead of opening them in a new tab.</p>
  <p>I have a very simple <em>test.html</em> containing:</p>
  <pre><code>&lt;a href=&quot;Test.txt&quot; target=&quot;_blank&quot;&gt;Text&lt;/a&gt;
  </code></pre>
  <p>If I upload <em>test.html</em> and <em>Test.txt</em> to my website (running on LiteSpeed V7.9) clicking the link downloads the <em>Test.txt</em>.</p>
  <p>If I add <em>test.html</em> and <em>Test.txt</em> to the ROOT webapp of a complete fresh jetty setup (<a href="https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/10.0.6/jetty-home-10.0.6.zip" rel="nofollow noreferrer">downloaded current version 10.0.6</a>) and click the link from http://localhost:8080/test.html the file opens a new tab.</p>
  <p>So I'm hoping there must be some configuration to define the behavior but haven't found one looking in the <em>jetty.xml</em>.</p>
  <p>EDIT: I downloaded a tomcat 9.0.52 and tested the behavior, it is the same as with jetty. Considering that other common webservers use the same handling I think it would be bad to change global configuration. According to the comments it would make more sense to use e.g. the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download" rel="nofollow noreferrer">download</a> attribute for links.</p>