It's a string not a java.net.URL.  .getRequestURL() returns a StringBuffer, that's what the .toString() call is for.