Skip to content

Commit

Permalink
#14 Improved the doc + some minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kolorobot committed May 15, 2021
1 parent b44604f commit 00cb739
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 20 deletions.
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
Spring Boot and Thymeleaf with Maven
====================================
Spring Boot 2 and Thymeleaf with Maven
======================================

- Spring Boot 2
- Web application (WAR) packaging as well as self-contained JAR
- Thymeleaf with Java 8 Time Dialect and Layout Dialect
- WebJars
- Selenium configuration included
- `Thymeleaf` with following dialects: Java 8 Time, Layout and Security
- `WebJars`

Prerequisites
-------------

- JDK 11 and JAVA_HOME environment variable set
- `JDK 11` and `JAVA_HOME` environment variable set

Building the project
--------------------
Expand All @@ -27,26 +26,35 @@ Run the project with:

./mvnw clean spring-boot:run

Navigate to:

http://localhost:8080

Login with: `user` and `demo`

Package the application
-----------------------

To package the project run:

./mvnw clean package

Open the application
--------------------
Screenshots
-----------

Application will be running on http://localhost:8080
- Login

To login enter `user` and `demo`
![login](screenshots/login.png)

- Dashboard

![dasboard](screenshots/dashboard.png)

Known issues
------------

- Text templates example does not work
- Selenium configuration does not work
On my blog:
-----------

Referenced articles:
--------------------
Articles on my blog referencing to this project:

- [Java 8 Date & Time with Thymeleaf](http://blog.codeleak.pl/2015/11/how-to-java-8-date-time-with-thymeleaf.html)
- [Spring Boot and Thymeleaf with Maven](http://blog.codeleak.pl/2014/04/how-to-spring-boot-and-thymeleaf-with-maven.html)
Expand Down
Binary file added screenshots/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/main/resources/templates/fragments/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">My project</a>
<p class="navbar-brand">My project</p>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="#" th:href="@{/}">Home</a></li>
<li><a href="#" th:href="@{/logout}">Logout</a></li>
</ul>
</div>
<!--/.nav-collapse -->
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/templates/th-form.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
<label for="tags">Tags (e.g. #tag1 #tag2 #tag3)</label>
<input type="text" id="tags" th:value="*{tags}" name="tags" class="form-control">
</div>
<input type="submit" class="btn btn-success" value="Add">
<input type="submit" class="btn btn-success" value="Process">
</form>
</div>
<div class="col-md-6">
<h2>Processed text template</h2>
<pre th:text="${text}">
<pre th:text="${#strings.defaultString(text, '<!-- Send the form first -->')}">
Demo
</pre>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/th-objects.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>Session Attributes</h1>

<section id="servlet-context-attributes">
<h1>Servlet Context</h1>
<table>
<table class="table">
<tr>
<td>My context attribute</td>
<!-- Retrieves the ServletContext attribute 'myContextAttribute' -->
Expand Down

0 comments on commit 00cb739

Please sign in to comment.