// read value of the path parameter
expression = injection.getExpression().getELExpression();
value = elUtils.getValue(context, expression);
if (value == null)
{
throw new PrettyException("PrettyFaces: Exception occurred while building URL for MappingId < "
+ mapping.getId() + " >, Required value " + " < " + expression + " > was null");
}
// convert the value to a string using the correct converter
Converter converter = context.getApplication().createConverter(value.getClass());
if (converter != null)
{
String valueAsString = converter.getAsString(context, new NullComponent(), value);
if (valueAsString == null)
{
throw new PrettyException("PrettyFaces: The converter <" + converter.getClass().getName()
+ "> returned null while converting the object <" + value.toString() + ">!");
}
parameterValues.add(valueAsString);
}
else
{
parameterValues.add(value.toString());
}
}
result = parser.getMappedURL(parameterValues);
}
catch (ELException e)
{
throw new PrettyException("PrettyFaces: Exception occurred while building URL for MappingId < "
+ mapping.getId() + " >, Error occurred while extracting values from backing bean" + " < "
+ expression + ":" + value + " >", e);
}
return result;