Iterator i = spec.getParameterNames().iterator();
while (i.hasNext())
{
String name = (String) i.next();
IParameterSpecification parameterSpec = spec.getParameter(name);
String defaultValue = parameterSpec.getDefaultValue();
if (defaultValue == null)
continue;
// the parameter has a default value, so it must not be required
if (parameterSpec.isRequired())
throw new ApplicationRuntimeException(PageloadMessages
.parameterMustHaveNoDefaultValue(component, name), component, parameterSpec
.getLocation(), null);
// if there is no binding for this parameter, bind it to the default value.
// In 3.0, default-value as always an OGNL expression, but now its a locator.
if (component.getBinding(name) == null)
{
String description = PageloadMessages.defaultParameterName(name);
IBinding binding = _bindingSource.createBinding(
component,
description,
defaultValue,
parameterSpec.getLocation());
component.setBinding(name, binding);
}
}
}