I have a scenario where a user clicks on the restaurant link (to search for restaurants in a specific place). I have to check if the location is set or not. If it is not installed, I want to redirect it to a page that allows it to set the location, and then return to the search results filtered by the given location. I use response.sendRedirect(url)to redirect the user to the location page. But how can I send the redirect URL (i.e. the URL where I want to send the user after it's installed)?
I tried this:
response.sendRedirect("/location/set.html?action=asklocation&redirectUrl="+
request.getRequestUri()+request.getQueryString());
but this does not work and error 404 is displayed; In addition, the URL generated in the browser does not look very good.
Please, if someone can solve the problem ...
source
share