getBinding("scriptPath")));
if (scriptPath == null && scriptAsset == null)
throw new ApplicationRuntimeException(HTMLMessages.noScriptPathError());
IScriptSource source = getScriptSource();
Resource scriptLocation = null;
if (scriptPath != null) {
// If the script path is relative, it should be relative to the Script component's
// container (i.e., relative to a page in the application).
Resource rootLocation = getContainer().getSpecification().getSpecificationLocation();
scriptLocation = rootLocation.getRelativeResource(scriptPath);
} else
scriptLocation = scriptAsset.getResourceLocation();
try
{
return source.getScript(scriptLocation);
}
catch (RuntimeException ex)
{
throw new ApplicationRuntimeException(ex.getMessage(), this, getBinding("script")
.getLocation(), ex);