private static String getFullImagePath ( String imgSrc , BinaryResourcesHandler binaryRsHandler , HttpServletRequest request ) { String contextPath = request . getContextPath ( ) ; // relative path if ( ! binaryRsHandler . getConfig ( ) . getGeneratorRegistry ( ) . isGeneratedBinaryResource ( imgSrc ) && ! imgSrc . startsWith ( "/" ) ) { imgSrc = PathNormalizer . concatWebPath ( request . getRequestURI ( ) , imgSrc ) ; int idx = imgSrc . indexOf ( contextPath ) ; if ( idx > - 1 ) { imgSrc = imgSrc . substring ( idx + contextPath . length ( ) ) ; } } return imgSrc ; }
Returns the full image path to handle the relative path