Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Jetty 12 support for extensionless war files with extracting disabled?
  • From: Stefan Feenstra <stefan.feenstra@xxxxxxx>
  • Date: Fri, 14 Jun 2024 23:57:29 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; 1; spf=pass; dmarc=pass action=none; dkim=pass; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed;; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=48P9YJw3wGkD+F8pX2Etss4yjEpGrLsJNNqkUZK6dFU=; b=NuZgTky7DvYvFrfPvc6ZTlf5dUeTzjG4dNbfv5/BPYRbosOY5vy3NMQJ7qitfmyZKOr0TEIW2spRpUhjVIpU2NRR4uQa9VH9d/A5iUnpQalkofdiUqTQragF+WDlwm9YyKR1nteCGFjFuu1VfmUeCJHIrFSgqsq4bo8hZ2IKLv/9TjTJJQipAFbip7bCp62BrFOf6gsl+wg6UCPlcxTksRNoLOslvMQ+FGGG/tatO5HVvueQp8MpS/9njkoIYN57stGnlMm4xnMk9a9IqcnQlZuwG6uocbIsRORIdMnpsW4EP0O+tetobA+r0znVPyVUUoh0/NK5ZekC7jznuqKCjQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901;; cv=none; b=laYEkjDAPHAiE0HAmnJAlv1wVOD33OXUNdsZhVqA8FqGKtVYA1OxIn2C90B8e+Lk/2a4/vd7UcSeMklsvISQhgn8kpLgtXUGXhi8crcD0QdbnF43sBC6y9FZJwZUx/9J4gO6XoemOa/TgNaveQCPKOpCvM2LwkgtYDDtm7EV4C+5yr+sYQgY0x7Eyilf6OXaVPiSwTlFyPctfeWqIfk+6EtF89QgupBdYC71CpbPcTgADJZ50MJzImXrFQRXvG6eahUYXeOPwP1m3kjFl8hnJrH0+JBvFfDJaT+LuprQ3T46zucrr27zJ4ICGQ5/Q1BvnqcSSRg17zMOj3O4QnOsFQ==
  • Delivered-to: jetty-users@xxxxxxxxxxx
  • List-archive: <>
  • List-help: <>
  • List-subscribe: <>, <>
  • List-unsubscribe: <>, <>
  • Msip_labels:
  • Thread-index: AQHavrS00tMIRnuWjkCeLzQQL1Gv6A==
  • Thread-topic: Jetty 12 support for extensionless war files with extracting disabled?


For one of our applications we have been using Jetty for a long time, originally jetty 8, then 9 and we recently upgraded to Jetty 12, as part of this, we also upgraded to ee10. We are however having problems with Jetty 12 - We have a few odd requirements:
  • Webapps have to be on the disk without an extension or with a custom extension to prevent security tools from blocking the WebApps (currently we have a mix of both extensionless and with a custom extension)
  • Webapps should not be extracted, but loaded from the war file.
  • The location where Jetty is located is different on different machines (not always the same location.)

This used to work in Jetty 9 - However in Jetty 12 (tested on 12.0.9) Jetty is extracting the war files when we do not want these to be extracted.
Looking at the jetty code the following change is causing the difference in behaviour:

Jetty 12:
if (Resources.isReadableFile(webApp) && FileID.isArchive(webApp.getURI()) && !webApp.getURI().getScheme().equalsIgnoreCase("jar"))

Jetty 9:
if (webApp.exists() && !webApp.isDirectory() && !webApp.toString().startsWith("jar:"))

In Jetty 12 an additional check seems to have been added which checks if the file extension is either jar, war or zip.
Is there any way that we can still load files without an extension with the above requirements?

NB: We load 2 of our webapps using web xml files and some webapps are loaded by the 2 webapps that get loaded initially.


Back to the top