Skip to content

Example project for Spring Boot and thymeleaf</description>

Notifications You must be signed in to change notification settings

facu0202/spring-thymeleaf-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

spring-thymeleaf-example

Preface

This project contains a simple example with Spring Boot and Thymeleaf.

Getting Started

You need clone the repository https://github.com/facu0202/spring-thymeleaf-example.git. If you use eclipse, you can import proyect using "import-> Existing Maven Project".

For run application, you run de application with maven command "mvn spring-boot:run". If you use eclipse create a Maven Build and add "spring-boot:run" as Goals.

How to uses it

You have tow url:

Details

The application was built using "spring initializr" with the params:

  • Web, Actuator, DevTools, Thymeleaf.

The application has only one controller and the magic is:

@RequestMapping("/list")
String list(Model model){
	
	model.addAttribute("messages", messagesService.findAll());
	return "list";
}

yes, it's exactly like Spring MVC :)

The html has:

<tr th:each="message : ${messages}">
			    <td th:text="${message.id}"></td>
			    <td th:text="${message.title}"></td>
			    <td th:text="${message.text}"></td>
</tr>    

If you have any cuestion send and email facundoferro@gmail.com

About

Example project for Spring Boot and thymeleaf</description>

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published