Spring Boot with Thymeleaf 3 using OGNL or SpEL or a mix? - spring-boot

I am using Spring Boot 1.4 with Thymeleaf 3.
What syntax is used? OGNL or SpEL?
Appendix A lists no Thymeleaf parameter to configure.

If you are using the spring-boot-starter-thymeleaf it configures automatically the integration of Thymeleaf with Spring, using the SpringTemplateEngine and the SpringStandardDialect.
That means the active variable expression language is SpEL. It also provides other integration features. The links point to the 2.1 version documentation, but I think it's the same in the 3.0 version.

Related

Can I use "Spring Data JDBC" with Spring Boot 1.5.x?

I have tried to figure out which version of spring-data-jdbc to use with Spring Boot 1.5.20.RELEASE (= Spring Framework 4.3.23.RELEASE) - but I can't find that info anywhere.
Is it because spring-data-jdbc only work with Spring Boot 2.x / Spring Framework 5.x?
Specifically I want to use #Query, #EnableJdbcRepositories, etc.
When I look at the release notes for Spring Data Ingalls SR20 (the release train that matches Boot 1.5.20.RELEASE / Framework 4.3.23.RELEASE) it looks like spring-data-jdbc is only supported in Lovelace (Boot 2.x and Framework 5.x): https://spring.io/blog/2019/04/10/spring-data-lovelace-sr6-kay-sr14-ingalls-sr20-released
EDIT & ANSWER: As per comment from #JensSchauder: spring-data-jdbc is a (fairly) new project created from scratch. There is no way to use it with Spring Framework 4.
If you look at the spring-data-jdbc pom.xml it uses spring-data-parent to manage Spring Framework version by defining and applying spring.version property. You must ensure that this Spring Framework version is compatible with whatever version you are using.
The first available spring-data-jdbc:1.0.0.RELEASE version uses spring-data-parent:2.1.0.RELEASE parent which requires Spring Framework 5.1:
<spring>5.1.0.RELEASE</spring>
It's not be recommended to use spring-data-jdbc with lower Spring Framework version. Since Spring Boot 1.5.X uses Spring Framework 4.X the answer would be no.

thymeleaf vs thymeleaf-spring4 dependency

Question is simple, what is the difference between the above dependencies? Does the first one enough for a springboot app or the second contains something special?
Artifact thymeleaf is the Core library.
Artifact thymeleaf-spring4 allows to integrate Thymeleaf with the Spring Framework, especially (but not only) Spring MVC. Btw there are several Thymeleaf integration packages for different Spring versions are available at the moment:
thymeleaf-spring3, thymeleaf-spring4, thymeleaf-spring5.
Information from thymeleaf-spring official documentation:
Thymeleaf offers a set of Spring integrations that allow you to use it as a fully-featured substitute for JSP in Spring MVC applications.
These integrations will allow you to:
Make the mapped methods in your Spring MVC #Controller objects forward to templates managed by Thymeleaf, exactly like you do with JSPs.
Use Spring Expression Language (Spring EL) instead of OGNL in your templates.
Create forms in your templates that are completely integrated with your form-backing beans and result bindings, including the use of property editors, conversion services and validation error handling.
Display internationalization messages from message files managed by Spring (through the usual MessageSource objects).
Resolve your templates using Spring’s own resource resolution mechanisms.
If you use Spring Boot, you can just use the spring-boot-starter-thymeleaf dependency. It already contains the above two dependencies as well as some others.

What is the meaning of "Full Servlet 3.1 signature support in Spring-provided Filter implementations" in Spring 5 new features?

Spring 5 brings "Full Servlet 3.1 signature support in Spring-provided Filter implementations" according to The "What's New in Spring 5"
But what does this feature mean? Is there any new Servlet 3.1 signature support added in spring 5?
You can get a hint of what this means from some issues from Spring JIRA like the one here and here. Basically the Spring filter implementation ( typically used in Spring security) obviously used ServletRequest/ServletResponse parameters in doFilter method which were not fully Servlet 3.1 API compliant. With Spring version 5 the support has been complete in contrast to previous version where it was incremental ( or as a bug fix)

Configure Spring AOP to be on or off

Is it possible to configure spring AOP for a aspect around a method to either be turned on or off through a configuration properties file. The expression for the around is
execution(* com.company.service.update(..))
If you are using spring 3.1 or 3.2 you can use spring profiles to achieve this.
If you are using spring 4 you can use profiles or conditional declarations.

Spring configuration using Java annotations

I have started working on an inventory management system (web application) using Spring Framework 3.1.1** and would like to configure Spring Framework using Java annotations. I searched Google, but I could not find a suitable example showing how to configure Spring Framework using Java annotations in a web application. Where is there a proper example or tutorial?
Spring Framework references are comprehensive. Refer to the Spring reference material, 3.11 Java-based container configuration.
Another option to consider is to use Java based configuration. It is more readable, and is easier than annotations.
Spring Documentation
Simple Example using Java based configuration

Resources