{
/*
* FIXME this will not work with dynamic view IDs... figure out another solution
* (<rewrite-view>/faces/views/myview.xhtml</rewrite-view> ? For now. Do not support it.
*/
UrlMapping mapping = config.getMappingById(outcome);
String viewId = mapping.getViewId();
if (mapping.isDynaView())
{
viewId = dynaview.calculateDynaviewId(context, mapping);
}
viewId = FacesNavigationURLCanonicalizer.normalizeRequestURI(context, viewId);
URL url = new URL(viewId);
url.getMetadata().setLeadingSlash(true);
QueryString qs = QueryString.build("");
if (viewId.contains("?"))
{
qs.addParameters(viewId);
}
qs.addParameters("?" + PrettyFacesWrappedResponse.REWRITE_MAPPING_ID_KEY + "=" + mapping.getId());
viewId = url.toString() + qs.toQueryString();
NavigationCase navigationCase = parent.getNavigationCase(context, fromAction, viewId);
return navigationCase;