String contextPath = request.getContextPath();
String loading_url = contextPath + LOADING_GIF_PATH;
String closing_url = contextPath + CLOSING_GIF_PATH;
// Create the template's substitution map...
MiniMap params = new MiniMap(2);
params.put("loading-gif", loading_url);
params.put("close-label-gif", closing_url);
// Run the substitutions through the template, and return the result...
PackagedTextTemplate template = new PackagedTextTemplate(LightboxBehavior.class, LIGHTBOX_JS_TEMPLATE);
return template.asString(params);
}