https://github.com/wet-boew/spring-boot-thymeleaf
A Spring Boot and Thymeleaf implementation of the the CDTS
https://github.com/wet-boew/spring-boot-thymeleaf
Last synced: 3 months ago
JSON representation
A Spring Boot and Thymeleaf implementation of the the CDTS
- Host: GitHub
- URL: https://github.com/wet-boew/spring-boot-thymeleaf
- Owner: wet-boew
- License: mit
- Created: 2016-06-07T04:27:26.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2025-02-21T11:17:05.000Z (3 months ago)
- Last Synced: 2025-02-21T12:25:58.038Z (3 months ago)
- Language: HTML
- Size: 508 KB
- Stars: 10
- Watchers: 13
- Forks: 19
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WET Centrally Distributed Template Solution (CDTS) for Spring Boot and Thymeleaf
This is a Spring Boot Starter that uses Thymeleaf to implement CDTS.
## Benefits of using this version of CDTS.
Since this version is based on Spring Boot, simply adding the dependency to your POM file is enough to do most of the configuration. The only config requried after that is to add the `WETTemplateInterceptor` to your list of interceptors.
After that, there is no need to extend any beans! Just write normal Spring MVC controllers and make sure your Thymeleaf templates reference one of the provided layouts (currently default and transactional layouts for internet use. Intranet templates haven't been added, yet).
This makes getting started with CDTS very easy, and your code will not rely on anything from the CDTS library specifically.
Also, since the templates are based on Thymeleaf, they are plain HTML5 by default and require no tags. This makes them much easier to read.
## Version
### Current
The current version of this library has the artifactId of `wet-cdts-spring-boot3-thymeleaf-starter` and the following requirements
* Java 17 minimum
* JakartaEE
* spring boot 3 / spring 6### Legacy
For spring boot 1.x / spring 4.x / Java EE / Java 7 minimum, please use use the artifact `wet-cdts-spring-boot-thymeleaf-starter` that's found under the
[thymeleaf2 branch](https://github.com/wet-boew/spring-boot-thymeleaf/tree/thymeleaf2).## Building wet-cdts-spring-boot-thymeleaf-starter
* Clone the repository
* From the repository root, using java 8, run `maven install`## How to use wet-cdts-spring-boot-thymeleaf-starter
1) Add the starter to your projects POM file.
```
ca.canada.ised.wet.cdts
wet-cdts-spring-boot3-thymeleaf-starter
RELEASE
```2) Add the WETTemplateInterceptor to your applications list of interceptors.
```
/**
* Web configuration.
*/
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
/** The cdn template interceptor. */
@Autowired
private WETTemplateInterceptor cdnTemplateInterceptor;
/** {@inheritDoc} */
@Override
public void addInterceptors(InterceptorRegistry registry) {
super.addInterceptors(registry);
registry.addInterceptor(cdnTemplateInterceptor);
}
}
```3) Use one of the supplied templates as the basis for your Thymeleaf templates.
```
Page Title
This content will be included in the "content" div of the template.
Language: lang
This screen, home.html, uses layout:decorator="layouts/layout"
See Side Menu Page
```## Manually Releasing
Currently the build infa does not allow direct contact to github, so releases will have to be done manually.
For tagging in eclipse, see https://wiki.eclipse.org/EGit/User_Guide#Tagging
1. Update the pom file manually to a released version, committing with message "creating a release of 4.0.32.X"
2. Ensure that the the project is built correctly
3. In eclipse, open the history view of the pom file
4. Click "Create Tag" on the commit
5. Enter tag name of "wet-cdts-spring-boot-thymeleaf-starter-4.0.32.X" with message "Releasing 4.0.32.X"
6. Push to upstream