After following the suggestion on How to have Jetty redirect http to https, we were able to get our standalone Jetty deployment to redirect all HTTP requests to HTTPS. The redirect however is a 302. How can we make this a 301 (permanent) redirect instead?
For reference, we added this to Jetty's etc/webdefault.xml:
<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>Everything in the webapp</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
</web-app>