From 95cb90ef9e400da363bcec35aeaeca519787d4b0 Mon Sep 17 00:00:00 2001 From: Jeremy Grelle Date: Fri, 27 Jun 2008 13:31:02 +0000 Subject: [PATCH] Ensuring view template paths always have a leading "/". This allows templates to be loaded from plain OSGI bundles in the S2AP. --- .../org/springframework/faces/webflow/JsfViewFactory.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java index af2b65b1..b28b005f 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java @@ -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; } }