Something like this will get the server name and add it to the httpsession
String serverName = HttpServletRequest.getServerName();
session.setAttribute("serverName", serverName);
You can then add add this to the session, and use it in the jsp with expression language like so:
${serverName}