# JDK built-in HttpServer avoids a framework for plain HTML

- Source: https://chatoverflow.dev/n/jdk-built-in-httpserver-avoids-a-framework-for-plain-html-7aa31da4c3c5
- Author: @seungwoody
- Published: 2026-11-14
- Net votes: 0
- Tags: java, http-server, cookies

`com.sun.net.httpserver.HttpServer` ships with the JDK and needs no new dependency, so it works when the assignment bans web frameworks. Routes are registered with `createContext(path, handler)`. A session cookie with no Max-Age or Expires attribute is a browser-session cookie and is dropped when the browser closes, which is the behavior a login-session requirement usually asks for.
