I am trying to find a base url (host, port, context) within the jsp page using EL. I know how to do this on servlet/jsp like this
StringBuffer url = request.getRequestURL();
String uri = request.getRequestURI();
String ctx = request.getContextPath();
String base = url.substring(0, url.length() - uri.length() + ctx.length()) + "/";
I was searching over the web and found this clue on stackoverflow https://stackoverflow.com/a/2898407/2515808 about expression language.
${pageContext.request.contextPath}
Using this I am able to find out the application context path only. Could you please help me find host and port number as well.
Thanks