getScheme() + "://" + getServerName() + ":" + getServerPort() + getContextPath()
The URL that the user sees will now have a port number, if it didn't have one before. OR, if the server is forwarding the request from somewhere else, it might expose a whole new URI bypassing the forwarding mechanism. My alternative was this:
String context = request.getContextPath();
String fullUrl = request.getRequestURL().toString(); URL url = new URL(fullUrl); String path = url.getPath(); String base = fullUrl.substring(0,fullUrl.indexOf(path)) + context;
Where base is the base of my web application as it was typed by the user. Does anyone forsee any problems with doing it this way? Any other ideas or warnings against using <base href="" >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]