//If no viewId found, don't try to derive it, just continue.
if (viewId == null)
{
return null;
}
FacesServletMapping mapping = getFacesServletMapping(context);
if (mapping == null || mapping.isExtensionMapping())
{
viewId = handleSuffixMapping(context, viewId);
}
else if(mapping.isPrefixMapping())
{
viewId = handlePrefixMapping(viewId,mapping.getPrefix());
}
else if (viewId != null && mapping.getUrlPattern().startsWith(viewId))
{
throw new InvalidViewIdException(viewId);
}
//if(viewId != null)