Elementary Full stack Development with Hypermedia and java 21

Abstract

Another approach instead of a SPA.

Example project: https://github.com/pdudits/hypermedia-java21

Java 21 String template:

  • better locality
  • IDE autocompletion
  • better error reporting

Interesting uses for processor

  • generate string template instance
    • Processor<StringTemplate, RuntimeException> RAW = st -> st;
  • construct other object type
    • Processor<StringTemplate, RuntimeException> XML = st -> DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(st.interpolate))));
  • input sanitization
    • construct a prepared statement filling values as parameters Can use JS library for frontend to understand server side rendering:
  • unpolyjs
  • htmx