Spring , SavedRequestAwareAuthenticationSuccessHandler, , do, URL- (, - <intercept-url pattern = "/purchase/*" access = "isAuthenticated()" /> ( access = "hasRole('user'), ) ( "/purchase/"productIdHere" /purchase?productId=someProductId), .
, :
@Controller
...
@RequestMapping(value = "/purchase..., method = ....)
public ModelAndView purchase(@PathVariable("productId") String/Long productId (or @RequestParam etc...)
Product someProduct = someService.getByProductId(productId);
ModelAndView mav = new ModelAndView("view.name");
mav.setObject("product",product);
return mav;
, , .
, .