From fac2079486797aac8d0372654294c0ad3cc439b8 Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Mon, 10 Nov 2008 19:48:48 +0000 Subject: [PATCH] SWF-948 Base path behavior inconsistent between flow-location and flow-location-pattern Now appending a tailing slash, if needed, to the base path when creating a relative resource. This works for both file system and classpath resources. --- .../webflow/config/FlowDefinitionResourceFactory.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionResourceFactory.java b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionResourceFactory.java index 5b60c694..d1f0cf94 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionResourceFactory.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/config/FlowDefinitionResourceFactory.java @@ -107,6 +107,11 @@ public class FlowDefinitionResourceFactory { resource = resourceLoader.getResource(path); } else { try { + String basePath = this.basePath; + if (!basePath.endsWith("/")) { + // the basePath must end with a slash to create a relative resource + basePath = basePath + "/"; + } resource = resourceLoader.getResource(basePath).createRelative(path); } catch (IOException e) { throw new IllegalStateException("The base path cannot be resolved from '" + basePath + "': "