can anyone help me. I cant understand, why @RequestParameter or request.getParameter() not working.
My controller:
@Controller
public class CheatController extends WebMvcConfigurerAdapter {
@RequestMapping(value = "/hello", method = RequestMethod.GET)
public String hello(@RequestParam("gg") String gg, Model model) {
return "hello";
}
}
And my view:
<html>
<body>
<form action="#" th:action="@{/hello}" method="get">
<input type="text" id="gg" name="gg" placeholder="Your data"/>
<input type="submit"/>
</form>
<span th:if="${gg != null}" th:text="${gg}">Static summary</span>
</body>
</html>