doolylol
doolylol

Reputation: 35

Actionlistener in Spring Boot and Thymeleaf

I am currently trying out with Spring Boot, and have developed some smaller CRUD-like applications with Spring Boot and Thymeleaf - and it seems to go just fine.

But isn't there any way of implementing ActionListeners or ClickListeners in Spring Boot with Thymeleaf, like you could with traditional Java GUI components or Vaadin e.g.?

Best regards

Upvotes: 0

Views: 1200

Answers (1)

K.Nicholas
K.Nicholas

Reputation: 11551

Web Technologies are different from Desktop technologies. There is a separation of computers: Your web browser is on your computer and the web page is on the server. When you click a button, the web browser creates a TCP/IP "internet" packet and sends it to the server so the web application can decide what to do about it.

In a Java/AWT desktop application, with ActionListeners, a click on a button ultimately ends up calling the application that's running on your computer. Even though it may do so through an "Event Patten" implementation, it's still just calling the method within your application.

In the Spring Framework, the application handles a "click" packet with a Controller. See Web MVC framework for an article of the Spring Framework. Especially pay attention to secion 13.3 on controllers in regards to your question.

Controllers interpret user input and transform such input into a sensible model which will be represented to the user by the view.

Upvotes: 1

Related Questions