diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/FlowResourceFlowViewResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/FlowResourceFlowViewResolver.java index da0f9923..2f136567 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/FlowResourceFlowViewResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/FlowResourceFlowViewResolver.java @@ -35,7 +35,7 @@ import org.springframework.webflow.mvc.view.FlowViewResolver; */ public class FlowResourceFlowViewResolver implements FlowViewResolver { - private static final boolean JSTL_PRESENT = ClassUtils.isPresent("javax.servlet.jsp.jstl.fmt.LocalizationContext"); + private static final boolean JSTL_PRESENT = ClassUtils.isPresent("javax.servlet.jsp.jstl.fmt.LocalizationContext", FlowResourceFlowViewResolver.class.getClassLoader()); private String defaultViewSuffix = ".jsp"; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcEnvironment.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcEnvironment.java index a2de6d0c..d5c9db86 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcEnvironment.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/builder/MvcEnvironment.java @@ -43,7 +43,7 @@ public enum MvcEnvironment { * @return the web environment the context is running in, or null if not running in a web environment */ public static MvcEnvironment environmentFor(ApplicationContext applicationContext) { - if (ClassUtils.isPresent("javax.portlet.PortletContext") && isPortletApplicationContext(applicationContext)) { + if (ClassUtils.isPresent("javax.portlet.PortletContext", MvcEnvironment.class.getClassLoader()) && isPortletApplicationContext(applicationContext)) { return MvcEnvironment.PORTLET; } else if (applicationContext instanceof WebApplicationContext) { return MvcEnvironment.SERVLET; @@ -53,7 +53,7 @@ public enum MvcEnvironment { } private static boolean isPortletApplicationContext(ApplicationContext applicationContext) { - return ClassUtils.isPresent("org.springframework.web.portlet.context.ConfigurablePortletApplicationContext") + return ClassUtils.isPresent("org.springframework.web.portlet.context.ConfigurablePortletApplicationContext", MvcEnvironment.class.getClassLoader()) && applicationContext instanceof ConfigurablePortletApplicationContext; }