How can I force a Servlet redirect to the welcome page without having to specify the exact path? Like just altering the path to the most upper one:
response.sendRedirect("/");
Which does obviously not work.
response.sendRedirect(response.encodeRedirectURL(request.getContextPath() + "/"));
The call to encodeRedirectURL is necessary if you want to support session tracking for browsers with cookie support disabled (i.e. using URL rewriting).
Thanks to Michael-O above, following solution:
response.sendRedirect(request.getContextPath());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With