You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2013/10/29 13:04:50 UTC
svn commit: r1536685 - in /myfaces/tobago/trunk:
tobago-core/src/main/faces-config/
tobago-core/src/main/java/org/apache/myfaces/tobago/component/
tobago-core/src/main/java/org/apache/myfaces/tobago/context/
tobago-core/src/main/java/org/apache/myfaces...
Author: lofwyr
Date: Tue Oct 29 12:04:50 2013
New Revision: 1536685
URL: http://svn.apache.org/r1536685
Log:
TOBAGO-1333: Refactoring: Tobago should not need its own UIViewRoot implementation
Added:
myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
- copied, changed from r1536629, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
Removed:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java
Modified:
myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPage.java
myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java
myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/faces/AbstractTobagoTestBase.java
myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml?rev=1536685&r1=1536684&r2=1536685&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml Tue Oct 29 12:04:50 2013
@@ -41,12 +41,6 @@
<component-class>org.apache.myfaces.tobago.component.UIMenuSelectOne</component-class>
</component>
- <!-- use Tobagos UIViewRoot -->
- <component>
- <component-type>javax.faces.ViewRoot</component-type>
- <component-class>org.apache.myfaces.tobago.component.UIViewRoot</component-class>
- </component>
-
<managed-bean>
<managed-bean-name>tobagoClientProperties</managed-bean-name>
<managed-bean-class>org.apache.myfaces.tobago.context.ClientProperties</managed-bean-class>
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java?rev=1536685&r1=1536684&r2=1536685&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ClientProperties.java Tue Oct 29 12:04:50 2013
@@ -27,7 +27,6 @@ import org.apache.myfaces.tobago.util.Va
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import java.io.Serializable;
@@ -69,20 +68,20 @@ public class ClientProperties implements
this(FacesContext.getCurrentInstance());
}
- private ClientProperties(FacesContext facesContext) {
+ private ClientProperties(final FacesContext facesContext) {
- ExternalContext externalContext = facesContext.getExternalContext();
+ final ExternalContext externalContext = facesContext.getExternalContext();
// user agent
- String requestUserAgent = (String) externalContext.getRequestHeaderMap().get("User-Agent");
+ final String requestUserAgent = externalContext.getRequestHeaderMap().get("User-Agent");
this.userAgent = UserAgent.getInstance(requestUserAgent);
if (LOG.isDebugEnabled()) {
LOG.debug("userAgent='" + this.userAgent + "' from header " + "'User-Agent: " + requestUserAgent + "'");
}
// theme
- String requestTheme = (String) externalContext.getRequestParameterMap().get("tobago.theme");
- TobagoConfig config = TobagoConfig.getInstance(facesContext);
+ final String requestTheme = externalContext.getRequestParameterMap().get("tobago.theme");
+ final TobagoConfig config = TobagoConfig.getInstance(facesContext);
// TODO log error if tobago config is not initialized
this.theme = config.getTheme(requestTheme);
if (LOG.isDebugEnabled()) {
@@ -92,7 +91,7 @@ public class ClientProperties implements
reset();
}
- public static ClientProperties getInstance(FacesContext facesContext) {
+ public static ClientProperties getInstance(final FacesContext facesContext) {
return (ClientProperties) VariableResolverUtils.resolveVariable(facesContext, MANAGED_BEAN_NAME);
}
@@ -104,7 +103,7 @@ public class ClientProperties implements
return contentType;
}
- public void setContentType(String contentType) {
+ public void setContentType(final String contentType) {
this.contentType = contentType;
reset();
}
@@ -113,7 +112,7 @@ public class ClientProperties implements
return theme;
}
- public void setTheme(Theme theme) {
+ public void setTheme(final Theme theme) {
this.theme = theme;
reset();
}
@@ -122,7 +121,7 @@ public class ClientProperties implements
return userAgent;
}
- public void setUserAgent(UserAgent userAgent) {
+ public void setUserAgent(final UserAgent userAgent) {
this.userAgent = userAgent;
reset();
}
@@ -131,12 +130,12 @@ public class ClientProperties implements
return debugMode;
}
- public void setDebugMode(boolean debugMode) {
+ public void setDebugMode(final boolean debugMode) {
this.debugMode = debugMode;
}
/**
- * @deprecated since 2.0.0, please use {@link UIViewRoot#getLocale()}
+ * @deprecated since 2.0.0, please use {@link javax.faces.component.UIViewRoot#getLocale()}
*/
public Locale getLocale() {
Deprecation.LOG.warn("Please get locale via UIViewRoot.");
@@ -146,9 +145,9 @@ public class ClientProperties implements
/**
* @deprecated since 2.0.0
* This setter should not be called from the application directly,
- * but via {@link UIViewRoot#setLocale(Locale locale)}
+ * but via {@link javax.faces.component.UIViewRoot#setLocale(Locale locale)}
*/
- public void setLocale(Locale locale) {
+ public void setLocale(final Locale locale) {
Deprecation.LOG.warn("Please set locale via UIViewRoot.");
FacesContext.getCurrentInstance().getViewRoot().setLocale(locale);
}
@@ -157,7 +156,7 @@ public class ClientProperties implements
return verticalScrollbarWeight;
}
- public void setVerticalScrollbarWeight(Measure verticalScrollbarWeight) {
+ public void setVerticalScrollbarWeight(final Measure verticalScrollbarWeight) {
this.verticalScrollbarWeight = verticalScrollbarWeight;
}
@@ -165,13 +164,13 @@ public class ClientProperties implements
return horizontalScrollbarWeight;
}
- public void setHorizontalScrollbarWeight(Measure horizontalScrollbarWeight) {
+ public void setHorizontalScrollbarWeight(final Measure horizontalScrollbarWeight) {
this.horizontalScrollbarWeight = horizontalScrollbarWeight;
}
- public void updateUserAgent(FacesContext facesContext) {
- ExternalContext externalContext = facesContext.getExternalContext();
- String requestUserAgent = (String) externalContext.getRequestHeaderMap().get("User-Agent");
+ public void updateUserAgent(final FacesContext facesContext) {
+ final ExternalContext externalContext = facesContext.getExternalContext();
+ final String requestUserAgent = externalContext.getRequestHeaderMap().get("User-Agent");
final UserAgent newUserAgent = UserAgent.getInstance(requestUserAgent);
if (newUserAgent != userAgent) {
userAgent = newUserAgent;
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPage.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPage.java?rev=1536685&r1=1536684&r2=1536685&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPage.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIPage.java Tue Oct 29 12:04:50 2013
@@ -19,14 +19,18 @@
package org.apache.myfaces.tobago.internal.component;
+import org.apache.myfaces.tobago.ajax.AjaxUtils;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.ComponentTypes;
import org.apache.myfaces.tobago.component.DeprecatedDimension;
import org.apache.myfaces.tobago.component.Facets;
import org.apache.myfaces.tobago.component.OnComponentPopulated;
import org.apache.myfaces.tobago.component.RendererTypes;
+import org.apache.myfaces.tobago.internal.ajax.AjaxInternalUtils;
+import org.apache.myfaces.tobago.internal.ajax.AjaxResponseRenderer;
import org.apache.myfaces.tobago.internal.layout.LayoutUtils;
import org.apache.myfaces.tobago.internal.util.Deprecation;
+import org.apache.myfaces.tobago.internal.util.FacesContextUtils;
import org.apache.myfaces.tobago.internal.webapp.TobagoMultipartFormdataRequest;
import org.apache.myfaces.tobago.layout.Box;
import org.apache.myfaces.tobago.layout.LayoutComponent;
@@ -35,15 +39,22 @@ import org.apache.myfaces.tobago.layout.
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.model.PageState;
import org.apache.myfaces.tobago.model.PageStateImpl;
+import org.apache.myfaces.tobago.util.ApplyRequestValuesCallback;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.util.CreateComponentUtils;
import org.apache.myfaces.tobago.util.DebugUtils;
+import org.apache.myfaces.tobago.util.FacesVersion;
+import org.apache.myfaces.tobago.util.ProcessValidationsCallback;
+import org.apache.myfaces.tobago.util.TobagoCallback;
+import org.apache.myfaces.tobago.util.UpdateModelValuesCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.el.ELContext;
import javax.el.ValueExpression;
+import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
+import javax.faces.component.ContextCallback;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
@@ -52,6 +63,7 @@ import javax.servlet.http.HttpServletReq
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
public abstract class AbstractUIPage extends AbstractUIForm
implements OnComponentPopulated, LayoutContainer, DeprecatedDimension {
@@ -62,6 +74,10 @@ public abstract class AbstractUIPage ext
public static final String FORM_ACCEPT_CHARSET = "utf-8";
+ private static final TobagoCallback APPLY_REQUEST_VALUES_CALLBACK = new ApplyRequestValuesCallback();
+ private static final ContextCallback PROCESS_VALIDATION_CALLBACK = new ProcessValidationsCallback();
+ private static final ContextCallback UPDATE_MODEL_VALUES_CALLBACK = new UpdateModelValuesCallback();
+
private String formId;
private String actionId;
@@ -82,26 +98,30 @@ public abstract class AbstractUIPage ext
@Override
public void encodeBegin(FacesContext facesContext) throws IOException {
-
- super.encodeBegin(facesContext);
- ((AbstractUILayoutBase) getLayoutManager()).encodeBegin(facesContext);
+ if (!AjaxUtils.isAjaxRequest(facesContext)) {
+ super.encodeBegin(facesContext);
+ ((AbstractUILayoutBase) getLayoutManager()).encodeBegin(facesContext);
+ }
}
@Override
public void encodeChildren(FacesContext facesContext) throws IOException {
-
- ((AbstractUILayoutBase) getLayoutManager()).encodeChildren(facesContext);
+ if (AjaxUtils.isAjaxRequest(facesContext)) {
+ new AjaxResponseRenderer().renderResponse(facesContext);
+ } else {
+ ((AbstractUILayoutBase) getLayoutManager()).encodeChildren(facesContext);
+ }
}
@Override
public void encodeEnd(FacesContext facesContext) throws IOException {
-
- ((AbstractUILayoutBase) getLayoutManager()).encodeEnd(facesContext);
- super.encodeEnd(facesContext);
+ if (!AjaxUtils.isAjaxRequest(facesContext)) {
+ ((AbstractUILayoutBase) getLayoutManager()).encodeEnd(facesContext);
+ super.encodeEnd(facesContext);
+ }
}
- @Override
- public void processDecodes(FacesContext facesContext) {
+ private void processDecodes0(FacesContext facesContext) {
checkTobagoRequest(facesContext);
@@ -110,12 +130,112 @@ public abstract class AbstractUIPage ext
markSubmittedForm(facesContext);
// invoke processDecodes() on children
- for (Iterator kids = getFacetsAndChildren(); kids.hasNext();) {
- UIComponent kid = (UIComponent) kids.next();
+ for (final Iterator kids = getFacetsAndChildren(); kids.hasNext();) {
+ final UIComponent kid = (UIComponent) kids.next();
kid.processDecodes(facesContext);
}
}
+ @Override
+ public void processDecodes(FacesContext context) {
+ if (context == null) {
+ throw new NullPointerException("context");
+ }
+ Map<String, UIComponent> ajaxComponents = AjaxInternalUtils.parseAndStoreComponents(context);
+ if (ajaxComponents != null) {
+ // first decode the page
+ AbstractUIPage page = ComponentUtils.findPage(context);
+ page.decode(context);
+ page.markSubmittedForm(context);
+ FacesContextUtils.setAjax(context, true);
+
+ // decode the action if actionComponent not inside one of the ajaxComponents
+ // otherwise it is decoded there
+ decodeActionComponent(context, page, ajaxComponents);
+
+ // and all ajax components
+ for (Map.Entry<String, UIComponent> entry : ajaxComponents.entrySet()) {
+ FacesContextUtils.setAjaxComponentId(context, entry.getKey());
+ invokeOnComponent(context, entry.getKey(), APPLY_REQUEST_VALUES_CALLBACK);
+ }
+ } else {
+ processDecodes0(context);
+ }
+ }
+
+ private void decodeActionComponent(
+ FacesContext facesContext, AbstractUIPage page, Map<String,
+ UIComponent> ajaxComponents) {
+ String actionId = page.getActionId();
+ UIComponent actionComponent = null;
+ if (actionId != null) {
+ actionComponent = findComponent(actionId);
+ if (actionComponent == null && FacesVersion.supports20() && FacesVersion.isMyfaces()) {
+ String bugActionId = actionId.replaceAll(":\\d+:", ":");
+ try {
+ actionComponent = findComponent(bugActionId);
+ //LOG.info("command = \"" + actionComponent + "\"", new Exception());
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ }
+ if (actionComponent == null) {
+ return;
+ }
+ for (UIComponent ajaxComponent : ajaxComponents.values()) {
+ UIComponent component = actionComponent;
+ while (component != null) {
+ if (component == ajaxComponent) {
+ return;
+ }
+ component = component.getParent();
+ }
+ }
+ invokeOnComponent(facesContext, actionId, APPLY_REQUEST_VALUES_CALLBACK);
+ }
+
+
+ @Override
+ public void processValidators(FacesContext context) {
+ if (context == null) {
+ throw new NullPointerException("context");
+ }
+
+ Map<String, UIComponent> ajaxComponents = AjaxInternalUtils.getAjaxComponents(context);
+ if (ajaxComponents != null) {
+ for (Map.Entry<String, UIComponent> entry : ajaxComponents.entrySet()) {
+ FacesContextUtils.setAjaxComponentId(context, entry.getKey());
+ invokeOnComponent(context, entry.getKey(), PROCESS_VALIDATION_CALLBACK);
+ }
+ } else {
+ super.processValidators(context);
+ }
+ }
+
+ @Override
+ public void processUpdates(FacesContext context) {
+ if (context == null) {
+ throw new NullPointerException("context");
+ }
+ Map<String, UIComponent> ajaxComponents = AjaxInternalUtils.getAjaxComponents(context);
+ if (ajaxComponents != null) {
+ for (Map.Entry<String, UIComponent> entry : ajaxComponents.entrySet()) {
+ invokeOnComponent(context, entry.getKey(), UPDATE_MODEL_VALUES_CALLBACK);
+ }
+ } else {
+ super.processUpdates(context);
+ }
+ }
+
+
+ @Override
+ public boolean invokeOnComponent(FacesContext context, String clientId, ContextCallback callback)
+ throws FacesException {
+ return ComponentUtils.invokeOnComponent(context, this, clientId, callback);
+ }
+
+
public void markSubmittedForm(FacesContext facesContext) {
// find the form of the action command and set submitted to it and all
// children
@@ -171,16 +291,14 @@ public abstract class AbstractUIPage ext
private void checkTobagoRequest(FacesContext facesContext) {
// multipart/form-data must use TobagoMultipartFormdataRequest
- String contentType = (String) facesContext.getExternalContext()
- .getRequestHeaderMap().get("content-type");
+ String contentType = facesContext.getExternalContext().getRequestHeaderMap().get("content-type");
if (contentType != null && contentType.startsWith("multipart/form-data")) {
Object request = facesContext.getExternalContext().getRequest();
boolean okay = false;
if (request instanceof TobagoMultipartFormdataRequest) {
okay = true;
} else if (request instanceof HttpServletRequestWrapper) {
- ServletRequest wrappedRequest
- = ((HttpServletRequestWrapper) request).getRequest();
+ ServletRequest wrappedRequest = ((HttpServletRequestWrapper) request).getRequest();
if (wrappedRequest instanceof TobagoMultipartFormdataRequest) {
okay = true;
}
@@ -190,19 +308,12 @@ public abstract class AbstractUIPage ext
LOG.error("Can't process multipart/form-data without TobagoRequest. "
+ "Please check the web.xml and define a TobagoMultipartFormdataFilter. "
+ "See documentation for <tc:file>");
- facesContext.addMessage(null, new FacesMessage("An error has occured!"));
+ facesContext.addMessage(null, new FacesMessage("An error has occurred!"));
}
}
}
- @Override
- public void processUpdates(FacesContext context) {
- super.processUpdates(context);
- updatePageState(context);
- }
-
/**
- *
* @deprecated PageState is deprecated since 1.5.0
*/
@Deprecated
@@ -210,7 +321,6 @@ public abstract class AbstractUIPage ext
}
/**
- *
* @deprecated PageState is deprecated since 1.5.0
*/
@Deprecated
@@ -245,13 +355,17 @@ public abstract class AbstractUIPage ext
this.actionPosition = actionPosition;
}
- /** @deprecated since 1.5.7 and 2.0.0 */
+ /**
+ * @deprecated since 1.5.7 and 2.0.0
+ */
public String getDefaultActionId() {
Deprecation.LOG.error("The default action handling has been changed!");
return null;
}
- /** @deprecated since 1.5.7 and 2.0.0 */
+ /**
+ * @deprecated since 1.5.7 and 2.0.0
+ */
public void setDefaultActionId(String defaultActionId) {
Deprecation.LOG.error("The default action handling has been changed!");
}
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java?rev=1536685&r1=1536684&r2=1536685&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/component/MethodOverwritingOfGeneratedUIComponentsUnitTest.java Tue Oct 29 12:04:50 2013
@@ -39,7 +39,6 @@ public class MethodOverwritingOfGenerate
private static final List<String> IGNORED_METHODS = Arrays.asList("getFamily", "saveState", "restoreState");
private static final List<String> IGNORED_COMPONENTS = Arrays.asList(
- UIViewRoot.class.getSimpleName(),
UIExtensionPanel.class.getSimpleName(),
UIMenuSelectOne.class.getSimpleName(),
UIWizard.class.getSimpleName(), // TODO: check what is here to do. Wizard is not currently working.
Modified: myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/faces/AbstractTobagoTestBase.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/faces/AbstractTobagoTestBase.java?rev=1536685&r1=1536684&r2=1536685&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/faces/AbstractTobagoTestBase.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/mock/faces/AbstractTobagoTestBase.java Tue Oct 29 12:04:50 2013
@@ -30,7 +30,6 @@ import org.apache.myfaces.tobago.compone
import org.apache.myfaces.tobago.component.UIOut;
import org.apache.myfaces.tobago.component.UIPanel;
import org.apache.myfaces.tobago.component.UIPopup;
-import org.apache.myfaces.tobago.component.UIViewRoot;
import org.apache.myfaces.tobago.config.TobagoConfig;
import org.apache.myfaces.tobago.context.ClientProperties;
import org.apache.myfaces.tobago.context.Theme;
@@ -92,7 +91,6 @@ public abstract class AbstractTobagoTest
application.addComponent(ComponentTypes.IN, UIIn.class.getName());
application.addComponent(ComponentTypes.OUT, UIOut.class.getName());
application.addComponent(ComponentTypes.PANEL, UIPanel.class.getName());
- application.addComponent("javax.faces.ViewRoot", UIViewRoot.class.getName());
application.addComponent("javax.faces.Command", javax.faces.component.UICommand.class.getName());
application.addComponent(ComponentTypes.COMMAND, UICommand.class.getName());
application.addComponent(ComponentTypes.LINK, UILink.class.getName());
Copied: myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java (from r1536629, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java?p2=myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java&p1=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java&r1=1536629&r2=1536685&rev=1536685&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/component/UIViewRoot.java Tue Oct 29 12:04:50 2013
@@ -51,6 +51,9 @@ import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
+/**
+ * @deprecated since 2.0.0
+ */
public class UIViewRoot extends javax.faces.component.UIViewRoot implements InvokeOnComponent {
private static final Logger LOG = LoggerFactory.getLogger(UIViewRoot.class);
Modified: myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java?rev=1536685&r1=1536684&r2=1536685&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-deprecation/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java Tue Oct 29 12:04:50 2013
@@ -62,21 +62,7 @@ public class ViewHandlerImpl extends Vie
if (LOG.isDebugEnabled()) {
LOG.debug("creating new view with viewId: '{}'", viewId);
}
- UIViewRoot viewRoot = base.createView(facesContext, viewId);
- // ensure tobago UIViewRoot RI don't create the component via application
- if (!(viewRoot instanceof org.apache.myfaces.tobago.component.UIViewRoot)) {
- UIViewRoot tobagoViewRoot = (UIViewRoot)
- facesContext.getApplication().createComponent(UIViewRoot.COMPONENT_TYPE);
- if (!(tobagoViewRoot instanceof org.apache.myfaces.tobago.component.UIViewRoot)) {
- LOG.warn("Application creating wrong UIViewRoot, forcing Tobago");
- tobagoViewRoot = new org.apache.myfaces.tobago.component.UIViewRoot();
- }
- tobagoViewRoot.setLocale(viewRoot.getLocale());
- tobagoViewRoot.setViewId(viewId);
- tobagoViewRoot.setRenderKitId(viewRoot.getRenderKitId());
- viewRoot = tobagoViewRoot;
- }
- return viewRoot;
+ return base.createView(facesContext, viewId);
}
public String getActionURL(FacesContext facesContext, String viewId) {