} else {
args = Collections.EMPTY_LIST;
}
// Need redirector in any case
Redirector redirector = context.getRedirector();
// If the continuation id is not null, it takes precedence over
// the function call, so we invoke it here.
String continuation = continuationId.resolve(context, env.getObjectModel());
if (continuation != null && continuation.length() > 0) {
try {
interpreter.handleContinuation(continuation, args, redirector);
} catch (Exception e) {
throw ProcessingException.throwLocated("Sitemap: error calling continuation", e, getLocation());
}
if (!redirector.hasRedirected()) {
throw new ProcessingException("Sitemap: continuation did not send a response", getLocation());
}
return true;
}
// We don't have a continuation id passed in <map:call>, so invoke
// the specified function
String name = functionName.resolve(context, objectModel);
if (name != null && name.length() > 0) {
try {
interpreter.callFunction(name, args, redirector);
} catch (Exception e) {
throw ProcessingException.throwLocated("Sitemap: error calling function '" + name + "'", e, getLocation());
}
if (!redirector.hasRedirected()) {
throw new ProcessingException("Sitemap: function '" + name + "' did not send a response", getLocation());
}
return true;
}