// try to get bean name
Class<?> clazz = actionSpec.getMethod().getDeclaringClass();
// build expression
PrettyExpression expression = buildPrettyExpression(clazz, actionSpec.getMethod().getName());
urlAction.setAction(expression);
// trace
if (log.isTraceEnabled())
{
log.trace("Adding action expression '" + urlAction.getAction() + "' to mapping: " + mapping.getId());
}
// register this action
mapping.addAction(urlAction);
}
}
for (QueryParamSpec queryParamSpec : queryParamList)
{
// create a query param for each referenced mapping
for (String mappingId : queryParamSpec.getMappingIds())
{
// Get the mapping references by the query param
UrlMapping mapping = urlMappings.get(mappingId);
// fail for unresolved mappings
if (mapping == null)
{
throw new IllegalArgumentException("Unable to find the mapping '" + mappingId
+ "' referenced at field '" + queryParamSpec.getFieldName() + "' in class '"
+ queryParamSpec.getOwnerClass().getName() + "'.");
}
// build UrlMapping
QueryParameter queryParam = new QueryParameter();
queryParam.setName(queryParamSpec.getName());
queryParam.setOnError(queryParamSpec.getOnError());
queryParam.setValidatorIds(join(queryParamSpec.getValidatorIds(), " "));
queryParam.setOnPostback(queryParamSpec.isOnPostback());
// optional validator method
if (!isBlank(queryParamSpec.getValidator()))
{
queryParam.setValidatorExpression(new ConstantExpression(queryParamSpec.getValidator()));
}
// try to get bean name
Class<?> clazz = queryParamSpec.getOwnerClass();
// build expression
PrettyExpression expression = buildPrettyExpression(clazz, queryParamSpec.getFieldName());
queryParam.setExpression(expression);
// trace
if (log.isTraceEnabled())
{