Server uses Java built-in HTTP Server jdk.httpserver
, server with virtual threads.
A small adapter is written around its API, in order to implement things like path matching, query string and handling of form POSTS.
That code is located in package io.zeromagic.fullstack.server
.
Requests are served by implementing Server.Handler
.
Handler would go matching attributes of a request such as request path segments and methods and return a response.
Data for shopping cart are implemented as few Java records in io.zeromagic.fullstack.domain
.
The framework defines a StringTemplate.Processor
which fills the response buffer with constituent parts of template, recursively processing nested String templates.
The code is defined in io.zeromagic.fullstack.templates.Framework
.
Based on this framework we define general layout of the page in class Page
.
The individual pages then extend and override the slots represented by (abstract) methods.