* @return the resolved absolute url as the client should see it. Note
* that absolute URLs passed to this metho are returned unchanged.
*/
public MarinerURL resolveURLRelativeToClient(MarinerURL url) {
MarinerURL result = url; // if absolute then pass through
Path path = Path.parse(getRequestURL(false).getPath());
if (url.isRelative()) {
// if the url is relative then resolve the paths
// we only care if it has more then one fragment (i.e. its a
// page request) so trim the requested page and resolve
// relative
if (path.getNumberOfFragments() > 1) {
path = new Path(path, 0, path.getNumberOfFragments()-1);
// resolve the url to request url after url is truncated.
path = path.resolve(url.getPath());
result = getRequestURL(true);
result.setPath(path.asString());
}
// get the client accessible URL
result = getVolantisBean().getClientAccessibleURL(result);
}
return result;