• Stars
    star
    739
  • Rank 59,298 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Java to HTML generator. Enjoy typesafe HTML generation.

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.6.0</version>
</dependency>

Or the gradle dependency

compile 'com.j2html:j2html:1.6.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

More Repositories

1

profile-summary-for-github

Tool for visualizing GitHub profiles
Vue
19,808
star
2

bubbly-bg

Beautiful bubbly backgrounds in less than 1kB (750 bytes gzipped)
JavaScript
1,601
star
3

spark-basic-structure

Example of one possible way of structuring a Spark application
Java
125
star
4

spark-websocket

Chat application tutorial using Spark and WebSockets
Java
69
star
5

loomylin

Java
43
star
6

kotlin-admin-template

Kotlin
39
star
7

isometric-tiles

Isometric landscape tiles (grass, arid, desert, snow) + decorations.
37
star
8

spark-file-upload

Java
26
star
9

spark-kotlin

Kotlin
26
star
10

javalin-website-example

Java
24
star
11

spark-ssl

Simple example showing how to set up SSL with Spark
Java
19
star
12

spark-intercooler

TodoMVC usin intercooler.js and Spark
Java
19
star
13

javalin-kotlin-example

Kotlin
17
star
14

javalin-realtime-collaboration-example

HTML
16
star
15

javalin-websocket-example

Java
16
star
16

spark-heroku-example

Tutorial explaining how to deploy Spark apps to Heroku
Java
16
star
17

javalinvue-example

Vue
15
star
18

javalinstagram

Vue
11
star
19

javalin-async-example

HTML
9
star
20

javalin-vuejs-example

JavaScript
9
star
21

javalin-auth-example

Kotlin
8
star
22

javalin-openapi-example

Java
6
star
23

javalin-testing-example

Java
5
star
24

javalin-html-forms-example

HTML
5
star
25

omeglin

JavaScript
4
star
26

javalin-jetty-sessions-example

Java
3
star
27

javalin-heroku-example

Java
3
star
28

dat-bodycontent

Example showing how to use Apache Velocity and the $bodyContent variable with Spark
Java
2
star
29

javalin-email-example

Java
2
star
30

twistrating

Java
2
star
31

jvm-brotli-example

Example showing how to use jvm-brotli (https://github.com/nixxcode/jvm-brotli)
Java
2
star
32

aaliyah

JavaScript
1
star
33

javalin-prometheus-example

Java
1
star
34

tipsydialog

JavaScript
1
star
35

javalin-cors-example

Kotlin
1
star
36

minecraft-vue-components

1
star
37

masteroppgave

Java
1
star