code: private String specializeJnlpTemplate( HttpServletRequest request, String respath, String jnlpTemplate )
      {
          String urlprefix = getUrlPrefix( request );
          int idx = respath.lastIndexOf( '/' ); //
          String name = respath.substring( idx + 1 );    // Exclude /
          String codebase = respath.substring( 0, idx + 1 ); // Include /
          jnlpTemplate = substitute( jnlpTemplate, "$$name", name );
          // fix for 5039951: Add $$hostname macro
          jnlpTemplate = substitute( jnlpTemplate, "$$hostname", request.getServerName() );
          jnlpTemplate = substitute( jnlpTemplate, "$$codebase", urlprefix + request.getContextPath() + codebase );
          jnlpTemplate = substitute( jnlpTemplate, "$$context", urlprefix + request.getContextPath() );
          // fix for 6256326: add $$site macro to sample jnlp servlet
          jnlpTemplate = substitute( jnlpTemplate, "$$site", urlprefix );
          return jnlpTemplate;
      }
docs: This method performs the following substituations
  $$name
  $$codebase
  $$context
  
  @param request      TODO
  @param respath      TODO
  @param jnlpTemplate TODO