Reputation: 17722
In Thymeleaf, I can output into a input's value using
<input th:value=${message} />
But I don't know how to output into the form action attribute.
Anyone ideas for the Thymeleaf HTML side?
Sample Java Spring-MVC controller code
@Controller
public class SampleController
@RequestMapping("/")
public String home(Model model) {
model.addAttribute("message", "Hello World!");
}
}
Upvotes: 0
Views: 1483
Reputation: 9125
Use th:action
For example, if you wanted to use the message
attribute as a parameter, you can do:
th:action="@{/someUri/foo(message=${message})}"
Upvotes: 4