I am using Spring/SpringMVC 5.x version, with Thymeleaf and Bootstrap on Tomcat server.
I need to ask something that maybe it might look to you very "st@pid" question.
In my html view I have the following button or a link:
I don't need to submit something, so I just use a simple button, so I think I don't need any form for it (except if I need for this).
In this html view (because of the thymeleaf library I added in the html tag), I need to add somehow, (but I don't know how), to this button or in the link, an expression of Spring EL or Thymeleaf EL, so I can invoke a method from a Spring bean, that I passed in the view, via a model which I added in my controller, e.g.:
If this is not understandable I can update my question with some code (I believe that Spring developers understand what I am talking about).
I don't know how to pass this expression. What attribute of button or link tag to use? I used "action" attribute for the button:
or "href" attribute in the link tag:
Very significant info
When I started my tomcat running the page, the actions in the EL are run successfuly on the load of the page. When I pressed the button or the link nothing happened.
I know that I cannot use "onclick" attribute because there we write JS code. But I need to run Java Spring code.
Any ideas about solving my problem?
Thanks in advance