Upgraded to JSF 2.0 baseline; building against JSF 2.2 now
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,8 +18,6 @@ package org.springframework.web.context.request;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
import javax.faces.application.Application;
|
||||
import javax.faces.component.UIViewRoot;
|
||||
import javax.faces.context.ExternalContext;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.portlet.PortletSession;
|
||||
@@ -43,6 +41,8 @@ import org.springframework.web.util.WebUtils;
|
||||
* callbacks, consider defining a Spring {@link RequestContextListener} in your
|
||||
* {@code web.xml}.
|
||||
*
|
||||
* <p>Requires JSF 2.0 or higher, as of Spring 4.0.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.5.2
|
||||
* @see javax.faces.context.FacesContext#getExternalContext()
|
||||
@@ -199,28 +199,13 @@ public class FacesRequestAttributes implements RequestAttributes {
|
||||
return getFacesContext().getViewRoot();
|
||||
}
|
||||
else if ("viewScope".equals(key)) {
|
||||
try {
|
||||
return ReflectionUtils.invokeMethod(UIViewRoot.class.getMethod("getViewMap"), getFacesContext().getViewRoot());
|
||||
}
|
||||
catch (NoSuchMethodException ex) {
|
||||
throw new IllegalStateException("JSF 2.0 API not available", ex);
|
||||
}
|
||||
return getFacesContext().getViewRoot().getViewMap();
|
||||
}
|
||||
else if ("flash".equals(key)) {
|
||||
try {
|
||||
return ReflectionUtils.invokeMethod(ExternalContext.class.getMethod("getFlash"), getExternalContext());
|
||||
}
|
||||
catch (NoSuchMethodException ex) {
|
||||
throw new IllegalStateException("JSF 2.0 API not available", ex);
|
||||
}
|
||||
return getExternalContext().getFlash();
|
||||
}
|
||||
else if ("resource".equals(key)) {
|
||||
try {
|
||||
return ReflectionUtils.invokeMethod(Application.class.getMethod("getResourceHandler"), getFacesContext().getApplication());
|
||||
}
|
||||
catch (NoSuchMethodException ex) {
|
||||
throw new IllegalStateException("JSF 2.0 API not available", ex);
|
||||
}
|
||||
return getFacesContext().getApplication().getResourceHandler();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,6 +28,8 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* {@link WebRequest} adapter for a JSF {@link javax.faces.context.FacesContext}.
|
||||
*
|
||||
* <p>Requires JSF 2.0 or higher, as of Spring 4.0.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.5.2
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user