I am using spring-3.2 version.
@RequestMapping("/company={companyId}/branch={branchId}/employee={employeeId}/info")
The requestmapping is used to map a URL, so in this case when ever a URL is called using
<a href="company=1/branch=1/employee=1/info" > employee info </a>
the method is called in the controller with the exact @RequestMapping annotation, now I want to create the "a href" tag dynamically and want to create companyId,branchId,or employeeId dynamically.
You could of course build the string pointing to the respective URL dynamically.
A first option would be using a javascript function. However, even this function has to take the IDs from somewhere. In my example, I suppose that there are javascript variables which already contain the right IDs.
Then your html would be like:
Another, more elegant solution would be to use the onClick event:
with the function
Hope I helped!