Reputation: 23187
I've coded this controller method implementation:
@RequestMapping(
value = "/userlogin4download/{id}",
method = RequestMethod.GET
)
@Override
public void downloadAfterGicar(
HttpServletRequest request,
HttpServletResponse response,
String id
) throws IOException {
LOG.info("Requested URI: " + request.getRequestURI());
LOG.info("{id} path param: " + id);
// other code
}
This method is reached. Nevertheless, logs:
Requested URI: /userlogin4download/cpd1-dc598036-f615-4200-b685-d24831fb9343
{id} path param: null
As you can see id
path param is null
.
Any ideas?
Upvotes: 0
Views: 806
Reputation: 1528
You are missing @PathVariable
@RequestMapping(value = "/userlogin4download/{id}", method = RequestMethod.GET)
@Override
public void downloadAfterGicar(HttpServletRequest request,
HttpServletResponse response,
@PathVariable("id") String id) throws IOException {
LOG.info("Requested URI: " + request.getRequestURI());
LOG.info("{id} path param: " + id);
// other code
}
Upvotes: 2