Spring boot Call java method with Parameter from Thymeleaf

Viewed 33

i am using spring boot 2.7.3 with thymeleaf i want to call java function from thymeleaf

for example the follwoing function i can call from html using [(${testfunction})


@ModelAttribute("testfunction")
    public String test() {
      return "test";
     

but i want to call a function with parameter for example, how i can call this function from html

@ModelAttribute("testfunction")

    public String test(String x) {

      return "something";

 }

i dont want to use static method

0 Answers
Related