8000 GitHub - m-o/j2html: Java to HTML generator. Enjoy typesafe HTML generation.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

m-o/j2html

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>0.7</version>
</dependency>

###Import TagCreator and start building HTML

import static j2html.TagCreator.*;

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

The above Java will result in the following HTML:

<body>
    <h1 class="example">Heading!</h1>
    <img src="img/hello.png">
</body>

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

About

Java to HTML generator. Enjoy typesafe HTML generation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.7%
  • Other 0.3%
0