If you're passing along the Client as a simple id, and using a GET request (no form submit) then you could embed the client id in the link's url; e.g.,
Code:
<a href="allindexes.htm?clientId=${clientId}">all indexes</a><
then in the allindexes controller something like
Code:
@RequestMapping(value="/allindexes.htm", method = RequestMethod.GET)
public String setupForm(@RequestParam(value = "clientId", required = false)
final String clientId, final ModelMap model) {
log.debug("clientId: {}", clientId);
And the allindexes controller would use the client id to fetch all of that client's stuff from the database.
But in my test/example I'm putting the @RequestMapping on the class:
Code:
@Controller
@RequestMapping("/get1.zug")
public final class Get1Controller {
private final transient Logger log = LoggerFactory.getLogger(getClass());
@RequestMapping(method = RequestMethod.GET)
public String setupForm(@RequestParam(value = "optParam", required = false)
final String optParam, final ModelMap model) {
log.debug("optParam: {}", optParam);
I can type in either get1.zug?optParam=xyz or get1.zug in my browser's address box. In the first case the log file shows optParam having xyz as its value, in the second it's null.
Also, if you go this route it's probably best to use the jsp/jstl <c:url> and <c : param> tags rather than manually building the url yourself.