I have a Spring Boot API (Stateless) with a Controller that receives a POST request, extracts the parameters of the POST request to send them through GET to my angular client. My question is if it's possible to send hidden parameters in HttpServletResponse.sendRedirect()?
What I have so far is this, but I do not want to show the parameters in the browser ...
@RequestMapping(value = "/return", method = RequestMethod.POST, headers = "Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
@ResponseBody
@Transactional
public void returnData(UriComponentsBuilder uriComponentsBuilder, final HttpServletRequest request,
final HttpServletResponse response) throws IOException {
String parameter=request.getParameter("billCode");
response.sendRedirect("http://localhost:4200/payment?parameterOne="+parameter);
}
Update:
I can't uses HttpSession session = request.getSession(false);
and then session.setAttribute("helloWorld", "Hello world")
because session
is Null
Many Thanks!