protected String getLocationForCreatedResource ( HttpServletRequest req , String objId ) { StringBuffer url = req . getRequestURL ( ) ; UriTemplate template = new UriTemplate ( url . append ( "/{objId}/" ) . toString ( ) ) ; return template . expand ( objId ) . toASCIIString ( ) ; }
Append the ID of the object that was created to the original request URL and return it .