/* * Copyright (c) 2014, 2026, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ import com.sun.net.httpserver.*; /** * Defines the JDK-specific HTTP server API, and provides the jwebserver tool * for running a minimal HTTP server. * *

The {@link com.sun.net.httpserver} package defines a high-level API for * building servers that support HTTP and HTTPS. The SimpleFileServer class * implements a simple HTTP-only file server intended for testing, development * and debugging purposes. A default implementation is provided via the * {@code jwebserver} tool and the main entry point of the module, which can * also be invoked with {@code java -m jdk.httpserver}. * *

The {@link com.sun.net.httpserver.spi} package specifies a Service Provider * Interface (SPI) for locating HTTP server implementations based on the * {@code com.sun.net.httpserver} API. *

* System properties used by the HTTP server API *

* The following is a list of JDK specific system properties used by the default HTTP * server implementation in the JDK. Any properties below that take a numeric value * assume the default value if given a string that does not parse as a number. *

* * @apiNote The API and SPI in this module are designed and implemented to support a minimal * HTTP server and simple HTTP semantics primarily. * * @implNote The default implementation of the HTTP server provided in this module is intended * for simple usages like local testing, development, and debugging. Accordingly, the design * and implementation of the server does not intend to be a full-featured, high performance * HTTP server. * * @implNote * Prior to JDK 26, in the JDK default implementation, the {@link HttpExchange} attribute map was * shared with the enclosing {@link HttpContext}. * Since JDK 26, by default, exchange attributes are per-exchange and the context attributes must * be accessed by calling {@link HttpExchange#getHttpContext() getHttpContext()}{@link * HttpContext#getAttributes() .getAttributes()}.
* A new system property, {@systemProperty jdk.httpserver.attributes} (default value: {@code ""}) * allows to revert this new behavior. Set this property to "context" to restore the pre JDK 26 behavior. * @toolGuide jwebserver * * @uses com.sun.net.httpserver.spi.HttpServerProvider * * @moduleGraph * @since 9 */ module jdk.httpserver { exports com.sun.net.httpserver; exports com.sun.net.httpserver.spi; uses com.sun.net.httpserver.spi.HttpServerProvider; }