When I try to form the link like below.
Link userLink = linkTo((controllerClass).slash("?location="+location+"&scheduledDepartur="+scheduleDepatur).withRel(USER_REL));
and it shows error as
The method slash(String) is undefined for the type Class<TrainController>
When try to use below link method I got
Link selfLink = linkTo(methodOn(controllerClass).getOffTrains(trainStatus, valid, locale).slash("?depatureLocation="+depatureLocation+"&scheduledDepartureDate="+scheduleDepatureDate).withSelfRel());
got below error
The method slash(String) is undefined for the type HttpEntity<TrainStatus>.
Help me to resolve this issue.
all your parenthesis are off.
should be
I'm surprised those query string parameters you have aren't methods on the getOffTrains controller method..then it would just work for you.