Merge pull request #26 from habuma/master

Pass classloader when calling ClassUtils.isPresent()
This commit is contained in:
Rossen Stoyanchev
2013-06-20 12:27:03 -07:00
2 changed files with 3 additions and 3 deletions

View File

@@ -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";

View File

@@ -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;
}