} else {
locationUri = new URI(url.getPath());
}
final String servletReference = locationUri.getScheme();
final Absolutizable absolutizable = (Absolutizable) CallStackHelper.getCurrentServletContext();
final String servletName;
// find out the type of the reference and create a service name
if (servletReference == null) {
// self-reference
if (absolutizable == null) {
throw new NoCallingServletServiceRequestAvailableException(
"A self-reference requires an active servlet request.");
}
servletName = absolutizable.getServiceName();
} else if (servletReference.endsWith(AbsoluteServletConnection.ABSOLUTE_SERVLET_SOURCE_POSTFIX)) {
// absolute reference
servletName = servletReference.substring(0, servletReference.length() - 1);
} else {
// relative reference
if (absolutizable == null) {
throw new NoCallingServletServiceRequestAvailableException(
"A relative servlet call requires an active servlet request.");
}
servletName = absolutizable.getServiceName(servletReference);
}
this.servletConnection = new AbsoluteServletConnection(servletName, locationUri.getRawPath(), locationUri
.getRawQuery());
this.servletConnection.setIfModifiedSince(0);