* @see org.apache.wicket.IRequestTarget#respond(org.apache.wicket.RequestCycle)
*/
public void respond(RequestCycle requestCycle)
{
Application application = requestCycle.getApplication();
SharedResources sharedResources = application.getSharedResources();
final String resourceKey = getRequestParameters().getResourceKey();
Resource resource = sharedResources.get(resourceKey);
// try to lazily register
if (resource == null)
{
int ix = resourceKey.indexOf('/');
if (ix != -1)
{
String className = resourceKey.substring(0, ix);
IClassResolver resolver = application.getApplicationSettings().getClassResolver();
Class<?> scope = null;
try
{
// First try to match mounted resources.
scope = Application.get().getSharedResources().getAliasClass(className);
// If that fails, resolve it as a fully qualified class
// name.
if (scope == null)
{
scope = resolver.resolveClass(className);
}
final CharSequence escapeString = application.getResourceSettings()
.getParentFolderPlaceholder();
// get path component of resource key, replace '..' with escape sequence to
// prevent crippled urls in browser
String path = resourceKey.substring(ix + 1).replace(escapeString, "..");
if (PackageResource.exists(scope, path, null, null))
{
PackageResource packageResource = PackageResource.get(scope, path);
if (sharedResources.get(resourceKey) == null)
{
sharedResources.add(scope, path, null, null, packageResource);
}
resource = packageResource;
}
}
catch (Exception e)