Issue
I have a jsp page called reports.jsp and I have displayed the links in the view for a user to click. How can I invoke Spring controller method by clicking on the link that will pass an argument.
Solution
You have to use @PathVariable
in order to do this. Example:
Jsp:
<a href="<c:url value="/test/${object.argument}" />" >hello</a>
Controller:
@RequestMapping(value = "/test/{argument}", method = RequestMethod.GET)
public String Controller(@PathVariable("argument") String argument) {
...
}
Answered By - George Ant