by chunsj · 3y ago · 0 comments
Swift has function builders which are part of the magic that makes such DSLs practical.
In Kotlin, which also runs on the JVM, this is possible much more easily than in Java: https://kotlinlang.org/docs/typesafe-html-dsl.html
At the relative bottom (Servelet API level) it works that way, servlets have a direct access to input/output stream, and they have to write plain byte[] (or string via Writer).
As for java syntax, it's not great for string manipulation, encoding (you will need some functions for all the html/javascript escaping).
If you see url's containing ".do" extensions - that was the standard for calling servlets w/o anything, it has changed, of course.