Hacker News new | ask | show | jobs
by xxs 997 days ago
>instead of generating HTML from code

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.

1 comments

Just a note about the “.do” extension: if I correctly recall, it was introduced by struts framework which used “Action” as a naming convention such as Spring uses “Controller” as suffix, and so they used “.do” as extension.
I've never used 'struts' personally, however mapping servlets directly to ".do" was a recommendation (can't quote books any longer, though - it has been well over 2 decades)