Oliver Becker f89957eeab Fix implementation flaw that called render() during tree construction
* Enables the new render capabilities also for content that was constructed with
  - TagCreator.each(Map, Function) and
  - TagCreator.each(Map, BiFunction)
* Adds convenience method TagCreator.each(DomContent...)
2021-06-04 15:57:16 +02:00
2020-08-15 17:34:50 +02:00
2021-05-21 12:36:51 +02:00
2015-10-05 20:19:18 +02:00
2020-08-15 17:34:50 +02:00
2020-08-15 17:38:58 +02:00

Workflow

j2html

Java to HTML generator. Enjoy typesafe HTML generation.

The project webpage is j2html.com.

Getting started

Add the maven dependency

<dependency>
    <groupId>com.j2html</groupId>
    <artifactId>j2html</artifactId>
    <version>1.4.0</version>
</dependency>

Or the gradle dependency

compile 'com.j2html:j2html:1.4.0'

Import TagCreator and start building HTML

import static j2html.TagCreator.*;

public class Main {
    public static void main(String[] args) {
        body(
            h1("Hello, World!"),
            img().withSrc("/img/hello.png")
        ).render();
    }
}

The above Java will result in the following HTML:

<body>
    <h1>Hello, World!</h1>
    <img src="/img/hello.png">
</body>

Find more examples at http://j2html.com/examples.html

Description
Java to HTML generator. Enjoy typesafe HTML generation.
Readme 4.9 MiB
Languages
Java 96.5%
CSS 1.8%
HTML 1.4%
JavaScript 0.3%