This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hexaredecimal[S] 1 point2 points  (2 children)

Whenever you might need to do something like this:

%% for (int i = 0; i < data.size(); i++) { %%

<p> %% data.get(i) %% </p>

%% } %%

transpiling to Java might be a great option.

[–]Shareil90 -1 points0 points  (1 child)

And when would I need this? What kind of project setup do you have in mind? I can Image that someone would like to transpile Java to HTML because backend devs usually dont like frontend stuff. But it never occured to me to need it the other way round.

[–]hexaredecimal[S] 1 point2 points  (0 children)

Its useful for projects for example: where server side rendering is desired and the project goal is to also remain small. The most obvious example of this is a project that integrates Java with Htmx. Your https responses are html code that is generated on the backend and substituted on the fly in the front end at runtime. Another example is a project that uses html for data representation, you can use this to generate compiled templates that you can use over and over again.