How to get the base url from the jsp request object? http://localhost:8080/SOMETHING/index.jsp, but I want the part till index.jsp, how is it possible in jsp?
There is one major flaw in @BalusC accepted answer though. Substring should start from 0 and not 1. Instead of
it should be
With 1 you get double forward slash: http://localhost:8080//appcontext/
With 0 you get, http://localhost:21080/appcontext/
In my application, request.getSession(false) always returned null when it was ending in double slash!!!