Ensuring view template paths always have a leading "/". This allows templates to be loaded from plain OSGI bundles in the S2AP.

This commit is contained in:
Jeremy Grelle
2008-06-27 13:31:02 +00:00
parent 1e58a38ba7
commit 95cb90ef9e

View File

@@ -161,7 +161,11 @@ public class JsfViewFactory implements ViewFactory {
throw new IllegalStateException(
"A ContextResource is required to get relative view paths within this context");
}
return ((ContextResource) viewResource).getPathWithinContext();
String viewPath = ((ContextResource) viewResource).getPathWithinContext();
if (!viewPath.startsWith("/")) {
viewPath = "/" + viewPath;
}
return viewPath;
}
}