You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2017/02/09 13:04:41 UTC
svn commit: r1782325 - in /myfaces/core/branches/2.3.x:
api/src/main/java/javax/faces/application/
api/src/main/java/javax/faces/component/behavior/
api/src/main/java/javax/faces/context/
impl-test/src/main/java/org/apache/myfaces/mc/test/core/mock/ im...
Author: tandraschko
Date: Thu Feb 9 13:04:40 2017
New Revision: 1782325
URL: http://svn.apache.org/viewvc?rev=1782325&view=rev
Log:
MYFACES-4085 Constants for "jsf.js", "javax.faces" and postback parameters
Modified:
myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ResourceHandler.java
myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/behavior/ClientBehaviorContext.java
myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/context/PartialViewContext.java
myfaces/core/branches/2.3.x/impl-test/src/main/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java
myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java
myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/resource/InternalClassLoaderResourceLoader.java
myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java
myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/renderkit/html/behavior/AbstractClientBehaviorTestCase.java
myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
Modified: myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ResourceHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ResourceHandler.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ResourceHandler.java (original)
+++ myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/application/ResourceHandler.java Thu Feb 9 13:04:40 2017
@@ -53,7 +53,17 @@ public abstract class ResourceHandler
* @since 2.2
*/
public static final String WEBAPP_RESOURCES_DIRECTORY_PARAM_NAME = "javax.faces.WEBAPP_RESOURCES_DIRECTORY";
-
+
+ /**
+ * @since 2.3
+ */
+ public static final String JSF_SCRIPT_RESOURCE_NAME = "jsf.js";
+
+ /**
+ * @since 2.3
+ */
+ public static final String JSF_SCRIPT_LIBRARY_NAME = "javax.faces";
+
public abstract Resource createResource(String resourceName);
public abstract Resource createResource(String resourceName, String libraryName);
Modified: myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/behavior/ClientBehaviorContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/behavior/ClientBehaviorContext.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/behavior/ClientBehaviorContext.java (original)
+++ myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/component/behavior/ClientBehaviorContext.java Thu Feb 9 13:04:40 2017
@@ -28,6 +28,15 @@ import javax.faces.context.FacesContext;
*/
public abstract class ClientBehaviorContext
{
+ /**
+ * @since 2.3
+ */
+ public static final String BEHAVIOR_SOURCE_PARAM_NAME = "javax.faces.source";
+
+ /**
+ * @since 2.3
+ */
+ public static final String BEHAVIOR_EVENT_PARAM_NAME = "javax.faces.behavior.event";
public static ClientBehaviorContext createClientBehaviorContext(FacesContext context,
UIComponent component,
Modified: myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/context/PartialViewContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/context/PartialViewContext.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/context/PartialViewContext.java (original)
+++ myfaces/core/branches/2.3.x/api/src/main/java/javax/faces/context/PartialViewContext.java Thu Feb 9 13:04:40 2017
@@ -37,6 +37,12 @@ public abstract class PartialViewContext
*/
public static final java.lang.String RESET_VALUES_PARAM_NAME = "javax.faces.partial.resetValues";
+ /**
+ * @since 2.3
+ */
+ public static final String PARTIAL_EVENT_PARAM_NAME =
+ "javax.faces.partial.event";
+
public abstract Collection<String> getExecuteIds();
public abstract PartialResponseWriter getPartialResponseWriter();
Modified: myfaces/core/branches/2.3.x/impl-test/src/main/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl-test/src/main/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl-test/src/main/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java (original)
+++ myfaces/core/branches/2.3.x/impl-test/src/main/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java Thu Feb 9 13:04:40 2017
@@ -26,11 +26,13 @@ import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
import javax.faces.component.UIInput;
+import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
import javax.faces.component.visit.VisitResult;
import javax.faces.context.FacesContext;
+import javax.faces.context.PartialViewContext;
import javax.faces.render.ResponseStateManager;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -211,12 +213,12 @@ public class MockMyFacesClient
{
final FacesContext facesContext = testCase.getFacesContext();
parameters.put("javax.faces.partial.ajax", "true");
- parameters.put("javax.faces.behavior.event", event);
- parameters.put("javax.faces.partial.event", "action".equals(event) ? "click" : event);
+ parameters.put(ClientBehaviorContext.BEHAVIOR_EVENT_PARAM_NAME, event);
+ parameters.put(PartialViewContext.PARTIAL_EVENT_PARAM_NAME, "action".equals(event) ? "click" : event);
applyStateFromPreviousRequest();
//parameters.put(ResponseStateManager.VIEW_STATE_PARAM,
// facesContext.getApplication().getStateManager().getViewState(facesContext));
- parameters.put("javax.faces.source", source.getClientId(facesContext));
+ parameters.put(ClientBehaviorContext.BEHAVIOR_SOURCE_PARAM_NAME, source.getClientId(facesContext));
if (execute == null)
{
parameters.put("javax.faces.partial.execute", source.getClientId(facesContext));
Modified: myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java (original)
+++ myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java Thu Feb 9 13:04:40 2017
@@ -32,6 +32,7 @@ import javax.faces.FactoryFinder;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewParameter;
import javax.faces.component.UIViewRoot;
+import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.component.html.HtmlBody;
import javax.faces.component.html.HtmlHead;
import javax.faces.component.visit.VisitCallback;
@@ -64,8 +65,6 @@ public class PartialViewContextImpl exte
private static final String PARTIAL_AJAX = "partial/ajax";
private static final String PARTIAL_AJAX_REQ = "javax.faces.partial.ajax";
private static final String PARTIAL_PROCESS = "partial/process";
- private static final String SOURCE_PARAM_NAME = "javax.faces.source";
- private static final String JAVAX_FACES_REQUEST = "javax.faces.request";
/**
* Internal extension for
@@ -258,7 +257,7 @@ public class PartialViewContextImpl exte
// with, e.g., a button).
String source = _facesContext.getExternalContext().getRequestParameterMap().get
- (PartialViewContextImpl.SOURCE_PARAM_NAME);
+ (ClientBehaviorContext.BEHAVIOR_SOURCE_PARAM_NAME);
if (source != null)
{
Modified: myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java (original)
+++ myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlAjaxBehaviorRenderer.java Thu Feb 9 13:04:40 2017
@@ -71,11 +71,6 @@ public class HtmlAjaxBehaviorRenderer ex
private static final String L_PAREN = "(";
private static final String R_PAREN = ")";
- /*if this marker is present in the request we have to dispatch a behavior event*/
- /*if an attached behavior triggers an ajax request this request param must be added*/
- private static final String BEHAVIOR_EVENT = "javax.faces.behavior.event";
- private static final String IDENTIFYER_MARKER = "@";
-
private static final String AJAX_SB = "oam.renderkit.AJAX_SB";
private static final String AJAX_PARAM_SB = "oam.renderkit.AJAX_PARAM_SB";
@@ -343,7 +338,7 @@ public class HtmlAjaxBehaviorRenderer ex
//parameterList.add(QUOTE + BEHAVIOR_EVENT + QUOTE + COLON + QUOTE + event + QUOTE);
paramBuffer.setLength(0);
paramBuffer.append(QUOTE);
- paramBuffer.append(BEHAVIOR_EVENT);
+ paramBuffer.append(ClientBehaviorContext.BEHAVIOR_EVENT_PARAM_NAME);
paramBuffer.append(QUOTE);
paramBuffer.append(COLON);
paramBuffer.append(QUOTE);
Modified: myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/resource/InternalClassLoaderResourceLoader.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/resource/InternalClassLoaderResourceLoader.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/resource/InternalClassLoaderResourceLoader.java (original)
+++ myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/resource/InternalClassLoaderResourceLoader.java Thu Feb 9 13:04:40 2017
@@ -22,6 +22,7 @@ import java.io.InputStream;
import java.net.URL;
import javax.faces.application.ProjectStage;
+import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
@@ -153,9 +154,9 @@ public class InternalClassLoaderResource
{
//handle jsf.js
final boolean javaxFacesLib = libraryName != null &&
- ResourceUtils.JAVAX_FACES_LIBRARY_NAME.equals(libraryName);
+ ResourceHandler.JSF_SCRIPT_LIBRARY_NAME.equals(libraryName);
final boolean javaxFaces = javaxFacesLib &&
- ResourceUtils.JSF_JS_RESOURCE_NAME.equals(resourceName);
+ ResourceHandler.JSF_SCRIPT_RESOURCE_NAME.equals(resourceName);
if (javaxFaces)
{
Modified: myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java (original)
+++ myfaces/core/branches/2.3.x/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java Thu Feb 9 13:04:40 2017
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map;
import javax.el.MethodExpression;
+import javax.faces.application.ResourceHandler;
import javax.faces.component.PartialStateHolder;
import javax.faces.component.UIComponent;
import javax.faces.component.UniqueIdVendor;
@@ -47,7 +48,6 @@ import javax.faces.view.facelets.TagHand
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletAttribute;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletTag;
import org.apache.myfaces.shared.renderkit.JSFAttr;
-import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.view.facelets.AbstractFaceletContext;
import org.apache.myfaces.view.facelets.FaceletCompositionContext;
import org.apache.myfaces.view.facelets.tag.TagHandlerUtils;
@@ -278,8 +278,8 @@ public class AjaxHandler extends TagHand
{
UIComponent outputScript = facesContext.getApplication().
createComponent(facesContext, "javax.faces.Output", "javax.faces.resource.Script");
- outputScript.getAttributes().put(JSFAttr.NAME_ATTR, ResourceUtils.JSF_JS_RESOURCE_NAME);
- outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, ResourceUtils.JAVAX_FACES_LIBRARY_NAME);
+ outputScript.getAttributes().put(JSFAttr.NAME_ATTR, ResourceHandler.JSF_SCRIPT_RESOURCE_NAME);
+ outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME);
outputScript.getAttributes().put(JSFAttr.TARGET_ATTR, "head");
//AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
Modified: myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java (original)
+++ myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/mc/test/core/mock/MockMyFacesClient.java Thu Feb 9 13:04:40 2017
@@ -26,11 +26,13 @@ import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
import javax.faces.component.UIInput;
+import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
import javax.faces.component.visit.VisitResult;
import javax.faces.context.FacesContext;
+import javax.faces.context.PartialViewContext;
import javax.faces.render.ResponseStateManager;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -225,12 +227,12 @@ public class MockMyFacesClient
boolean submit, boolean resetValues)
{
parameters.put("javax.faces.partial.ajax", "true");
- parameters.put("javax.faces.behavior.event", event);
- parameters.put("javax.faces.partial.event", "action".equals(event) ? "click" : event);
+ parameters.put(ClientBehaviorContext.BEHAVIOR_EVENT_PARAM_NAME, event);
+ parameters.put(PartialViewContext.PARTIAL_EVENT_PARAM_NAME, "action".equals(event) ? "click" : event);
applyStateFromPreviousRequest();
//parameters.put(ResponseStateManager.VIEW_STATE_PARAM,
// facesContext.getApplication().getStateManager().getViewState(facesContext));
- parameters.put("javax.faces.source", source);
+ parameters.put(ClientBehaviorContext.BEHAVIOR_SOURCE_PARAM_NAME, source);
if (execute == null)
{
parameters.put("javax.faces.partial.execute", source);
Modified: myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/renderkit/html/behavior/AbstractClientBehaviorTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/renderkit/html/behavior/AbstractClientBehaviorTestCase.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/renderkit/html/behavior/AbstractClientBehaviorTestCase.java (original)
+++ myfaces/core/branches/2.3.x/impl/src/test/java/org/apache/myfaces/renderkit/html/behavior/AbstractClientBehaviorTestCase.java Thu Feb 9 13:04:40 2017
@@ -22,6 +22,7 @@ import javax.faces.FactoryFinder;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.component.behavior.AjaxBehavior;
+import javax.faces.component.behavior.ClientBehaviorContext;
import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.context.ResponseWriter;
@@ -165,7 +166,7 @@ public abstract class AbstractClientBeha
int endPropIndex = output.indexOf('"' , startPropIndex );
String propertyValue = output.substring(startPropIndex, endPropIndex);
Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains("jsf.ajax.request("));
- Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains("javax.faces.behavior.event"));
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains(ClientBehaviorContext.BEHAVIOR_EVENT_PARAM_NAME));
Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains(attr.getClientEvent()));
return endPropIndex + 1;
}
@@ -217,7 +218,7 @@ public abstract class AbstractClientBeha
String propertyValue = output.substring(startPropIndex, endPropIndex);
Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.startsWith("jsf.util.chain("));
Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains("jsf.ajax.request("));
- Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains("javax.faces.behavior.event"));
+ Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains(ClientBehaviorContext.BEHAVIOR_EVENT_PARAM_NAME));
Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains(attr.getClientEvent()));
Assert.assertTrue("Property: " + attr.getName()+" Output: "+output, propertyValue.contains(value));
return endPropIndex + 1;
Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java (original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java Thu Feb 9 13:04:40 2017
@@ -53,6 +53,7 @@ import javax.faces.component.html.HtmlMe
import javax.faces.component.html.HtmlPanelGrid;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
+import javax.faces.context.PartialViewContext;
import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
import javax.faces.model.SelectItem;
@@ -284,7 +285,7 @@ public final class HtmlRendererUtils
Map<String, String> paramMap = facesContext
.getExternalContext().getRequestParameterMap();
String behaviorEventName = paramMap
- .get("javax.faces.behavior.event");
+ .get(ClientBehaviorContext.BEHAVIOR_EVENT_PARAM_NAME);
if (behaviorEventName != null)
{
List<ClientBehavior> clientBehaviorList = clientBehaviors
@@ -292,7 +293,7 @@ public final class HtmlRendererUtils
if (clientBehaviorList != null
&& !clientBehaviorList.isEmpty())
{
- String sourceId = paramMap.get("javax.faces.source");
+ String sourceId = paramMap.get(ClientBehaviorContext.BEHAVIOR_SOURCE_PARAM_NAME);
String componentClientId = component.getClientId(facesContext);
String clientId = sourceId;
if (sourceId.startsWith(componentClientId) &&
@@ -1580,13 +1581,13 @@ public final class HtmlRendererUtils
String clientId)
{
Map<String, String> params = facesContext.getExternalContext().getRequestParameterMap();
- String sourceId = params.get("javax.faces.source");
+ String sourceId = params.get(ClientBehaviorContext.BEHAVIOR_SOURCE_PARAM_NAME);
if (sourceId == null || !sourceId.equals(clientId))
{
return false;
}
boolean partialOrBehaviorSubmit = false;
- String behaviorEvent = params.get("javax.faces.behavior.event");
+ String behaviorEvent = params.get(ClientBehaviorContext.BEHAVIOR_EVENT_PARAM_NAME);
if (behaviorEvent != null)
{
partialOrBehaviorSubmit = ClientBehaviorEvents.ACTION.equals(behaviorEvent);
@@ -1595,7 +1596,7 @@ public final class HtmlRendererUtils
return partialOrBehaviorSubmit;
}
}
- String partialEvent = params.get("javax.faces.partial.event");
+ String partialEvent = params.get(PartialViewContext.PARTIAL_EVENT_PARAM_NAME);
if (partialEvent != null)
{
partialOrBehaviorSubmit = ClientBehaviorEvents.CLICK.equals(partialEvent);
Modified: myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java?rev=1782325&r1=1782324&r2=1782325&view=diff
==============================================================================
--- myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java (original)
+++ myfaces/core/branches/2.3.x/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java Thu Feb 9 13:04:40 2017
@@ -24,6 +24,7 @@ import java.util.Map;
import javax.faces.FacesWrapper;
import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -38,7 +39,9 @@ import org.apache.myfaces.shared.resourc
*/
public class ResourceUtils
{
+ @Deprecated //Use the one from JSF 2.3 ResourceHandler
public final static String JAVAX_FACES_LIBRARY_NAME = "javax.faces";
+ @Deprecated //Use the one from JSF 2.3 ResourceHandler
public final static String JSF_JS_RESOURCE_NAME = "jsf.js";
public final static String MYFACES_JS_RESOURCE_NAME = "oamSubmit.js";
@@ -115,8 +118,8 @@ public class ResourceUtils
{
getRenderedScriptResources(facesContext).put(
libraryName != null ? libraryName+'/'+resourceName : resourceName, Boolean.TRUE);
- if (JAVAX_FACES_LIBRARY_NAME.equals(libraryName) &&
- JSF_JS_RESOURCE_NAME.equals(resourceName))
+ if (ResourceHandler.JSF_SCRIPT_LIBRARY_NAME.equals(libraryName) &&
+ ResourceHandler.JSF_SCRIPT_RESOURCE_NAME.equals(resourceName))
{
// If we are calling this method, it is expected myfaces core is being used as runtime and note
// oamSubmit script is included inside jsf.js, so mark this one too.
@@ -181,7 +184,8 @@ public class ResourceUtils
// Check first if we have lucky, we are using myfaces and the script has
// been previously rendered
- if (isRenderedScript(facesContext, JAVAX_FACES_LIBRARY_NAME, JSF_JS_RESOURCE_NAME))
+ if (isRenderedScript(facesContext, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME,
+ ResourceHandler.JSF_SCRIPT_RESOURCE_NAME))
{
facesContext.getAttributes().put(RENDERED_JSF_JS, Boolean.TRUE);
return;
@@ -216,16 +220,17 @@ public class ResourceUtils
//Use more compatible way.
UIComponent outputScript = facesContext.getApplication().
createComponent(facesContext, JAVAX_FACES_OUTPUT_COMPONENT_TYPE, DEFAULT_SCRIPT_RENDERER_TYPE);
- outputScript.getAttributes().put(JSFAttr.NAME_ATTR, JSF_JS_RESOURCE_NAME);
- outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, JAVAX_FACES_LIBRARY_NAME);
+ outputScript.getAttributes().put(JSFAttr.NAME_ATTR, ResourceHandler.JSF_SCRIPT_RESOURCE_NAME);
+ outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME);
outputScript.encodeAll(facesContext);
}
else
{
//Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
Resource resource = facesContext.getApplication().getResourceHandler().createResource(
- JSF_JS_RESOURCE_NAME, JAVAX_FACES_LIBRARY_NAME);
- markScriptAsRendered(facesContext, JAVAX_FACES_LIBRARY_NAME, JSF_JS_RESOURCE_NAME);
+ ResourceHandler.JSF_SCRIPT_RESOURCE_NAME, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME);
+ markScriptAsRendered(facesContext, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME,
+ ResourceHandler.JSF_SCRIPT_RESOURCE_NAME);
writer.startElement(HTML.SCRIPT_ELEM, null);
writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
writer.writeURIAttribute(HTML.SRC_ATTR, resource.getRequestPath(), null);