Author: nbelaevski
Date: 2009-07-23 13:23:34 -0400 (Thu, 23 Jul 2009)
New Revision: 14992
Removed:
root/framework/trunk/api/src/main/java/org/ajax4jsf/application/StateHolder.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxStateHolder.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/ComponentsLoader.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/ComponentsLoaderImpl.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/TreeStructureNode.java
root/framework/trunk/impl/src/main/resources/org/ajax4jsf/org/w3c/tidy/
root/framework/trunk/impl/src/main/resources/org/ajax4jsf/webapp/output.properties
root/framework/trunk/impl/src/main/resources/org/ajax4jsf/webapp/tidy/
root/framework/trunk/impl/src/main/resources/org/ajax4jsf/xml/serializer/
root/framework/trunk/impl/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/
root/framework/trunk/impl/src/test/java/org/ajax4jsf/framework/util/
root/framework/trunk/impl/src/test/java/org/richfaces/model/impl/
Modified:
root/framework/trunk/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java
root/framework/trunk/impl/src/test/java/org/ajax4jsf/context/InitParametersTest.java
Log:
Removed StateManager
Deleted: root/framework/trunk/api/src/main/java/org/ajax4jsf/application/StateHolder.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/ajax4jsf/application/StateHolder.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/api/src/main/java/org/ajax4jsf/application/StateHolder.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -1,31 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.application;
-
-import javax.faces.context.FacesContext;
-
-public interface StateHolder {
-
- public Object[] getState(FacesContext context, String viewId, String sequence);
-
- public void saveState(FacesContext context, String viewId, String sequence, Object
state[]);
-
-}
\ No newline at end of file
Modified:
root/framework/trunk/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java
===================================================================
---
root/framework/trunk/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/api/src/main/java/org/ajax4jsf/application/ViewHandlerWrapper.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -41,6 +41,7 @@
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:57:12 $
*
*/
+//TODO remove
public class ViewHandlerWrapper extends ViewHandler {
private static final String HANDLERS = "org.ajax4jsf.VIEW_HANDLERS";
Deleted:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxStateHolder.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxStateHolder.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxStateHolder.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -1,227 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.application;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Map;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.context.ContextInitParameters;
-import org.ajax4jsf.util.LRUMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * @author asmirnov
- *
- */
-public class AjaxStateHolder implements Serializable, StateHolder {
-
- private static final Log _log = LogFactory.getLog(AjaxStateHolder.class);
- /**
- *
- */
- private static final long serialVersionUID = 6414488517358423537L;
- private static final String STATE_HOLDER = AjaxStateHolder.class.getName();
-
- private final LRUMap<String, LRUMap<String, StateReference>> views;
-
- private final int numberOfViews;
-
- private AjaxStateHolder(int capacity, int numberOfViews) {
- views = new LRUMap<String, LRUMap<String, StateReference>>(capacity+1);
- this.numberOfViews = numberOfViews;
- }
-
- public static StateHolder getInstance(FacesContext context) {
- if (null == context) {
- throw new NullPointerException(
- "FacesContext parameter for get view states object is null");
- }
- ExternalContext externalContext = context.getExternalContext();
- Object session = externalContext.getSession(true);
- Map<String, Object> sessionMap = externalContext.getSessionMap();
- if (_log.isDebugEnabled()) {
- _log.debug("Request for a view states holder instance");
- }
- StateHolder instance = (StateHolder) sessionMap.get(STATE_HOLDER);
- if (instance == null) {
- synchronized (session) {
- instance = (StateHolder) sessionMap.get(STATE_HOLDER);
- if (null == instance) {
- // Create and store in session new state holder.
- int numbersOfViewsInSession = ContextInitParameters
- .getNumbersOfViewsInSession(context);
- int numbersOfLogicalViews = ContextInitParameters
- .getNumbersOfLogicalViews(context);
- if (_log.isDebugEnabled()) {
- _log
- .debug("No AjaxStateHolder instance in session, create new for hold "
- + numbersOfViewsInSession
- + " viewId and "
- + numbersOfLogicalViews
- + " logical views for each");
- }
- instance = new AjaxStateHolder(numbersOfViewsInSession,
- numbersOfLogicalViews);
- sessionMap.put(STATE_HOLDER, instance);
- }
- }
- }
-
- return instance;
- }
-
- /**
- * Updates instance of AjaxStateHolder saved in session in order
- * to force replication in clustered environment
- *
- * @param context
- */
- protected void updateInstance(FacesContext context) {
- ExternalContext externalContext = context.getExternalContext();
- Object session = externalContext.getSession(true);
- Map<String, Object> sessionMap = externalContext.getSessionMap();
-
- synchronized (session) {
- sessionMap.put(STATE_HOLDER, this);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.application.StateHolder#getState(java.lang.String,
- * java.lang.Object)
- */
- public Object[] getState(FacesContext context, String viewId, String sequence) {
- if (null == viewId) {
- throw new NullPointerException(
- "viewId parameter for get saved view state is null");
- }
- Object state[] = null;
- synchronized (views) {
- LRUMap<String, StateReference> viewVersions = views.get(viewId);
- if (null != viewVersions) {
- if (null != sequence) {
- StateReference stateReference = viewVersions.get(sequence);
- if (null != stateReference) {
- state = stateReference.getState();
- }
- }
- if (null == state) {
- if (_log.isDebugEnabled()) {
- _log.debug("No saved view state for sequence "
- + sequence);
- }
- // state = viewVersions.getMostRecent();
- }
- } else if (_log.isDebugEnabled()) {
- _log.debug("No saved view states for viewId " + viewId);
- }
- }
- return state;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.application.StateHolder#saveState(java.lang.String,
- * java.lang.Object, java.lang.Object)
- */
- public void saveState(FacesContext context, String viewId, String sequence, Object[]
state) {
- if (null == viewId) {
- throw new NullPointerException(
- "viewId parameter for save view state is null");
- }
- if (null == sequence) {
- throw new NullPointerException(
- "sequence parameter for save view state is null");
- }
- if (null != state) {
- if (_log.isDebugEnabled()) {
- _log.debug("Save new viewState in session for viewId " + viewId
- + " and sequence " + sequence);
- }
- synchronized (views) {
- LRUMap<String, StateReference> viewVersions = views.get(viewId);
- StateReference stateReference = null;
- if (null == viewVersions) {
- // TODO - make size parameter configurable
- viewVersions = new LRUMap<String, StateReference>(
- this.numberOfViews+1);
- views.put(viewId, viewVersions);
- stateReference = new StateReference(state);
- viewVersions.put(sequence, stateReference);
- } else {
- stateReference = viewVersions.get(sequence);
- if(null == stateReference){
- stateReference = new StateReference(state);
- viewVersions.put(sequence, stateReference);
- } else {
- stateReference.setState(state);
- }
- }
- }
-
- //serialization is synchronized in writeObject()
- updateInstance(context);
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream stream)
- throws IOException {
-
- synchronized (views) {
- stream.defaultWriteObject();
- }
- }
-
- private void readObject(java.io.ObjectInputStream stream)
- throws IOException, ClassNotFoundException {
-
- stream.defaultReadObject();
- }
-
- @SuppressWarnings("serial")
- private static class StateReference implements Serializable {
- private Object[] state;
-
- public Object[] getState() {
- return state;
- }
-
- public void setState(Object[] state) {
- this.state = state;
- }
-
- /**
- * @param state
- */
- public StateReference(Object[] state) {
- super();
- this.state = state;
- }
- }
-}
Deleted:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -1,668 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.application;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamClass;
-import java.io.StringWriter;
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.faces.FacesException;
-import javax.faces.FactoryFinder;
-import javax.faces.application.StateManager;
-import javax.faces.component.UIComponentBase;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.render.RenderKit;
-import javax.faces.render.RenderKitFactory;
-import javax.faces.render.ResponseStateManager;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.context.ContextInitParameters;
-import org.ajax4jsf.model.KeepAlive;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * @author shura
- *
- */
-public class AjaxStateManager extends StateManager {
-
-
- public static final String CAPTURED_VIEW_STATE =
"org.ajax4jsf.captured_view_state";
-
- private final class SeamStateManagerWrapper extends StateManager {
- protected Object getComponentStateToSave(FacesContext arg0) {
- // do nothing
- return null;
- }
-
- protected Object getTreeStructureToSave(FacesContext arg0) {
- // do nothing
- return null;
- }
-
- protected void restoreComponentState(FacesContext arg0,
- UIViewRoot arg1, String arg2) {
- // do nothing
-
- }
-
- protected UIViewRoot restoreTreeStructure(FacesContext arg0,
- String arg1, String arg2) {
- // do nothing
- return null;
- }
-
- public UIViewRoot restoreView(FacesContext arg0, String arg1,
- String arg2) {
- // do nothing
- return null;
- }
-
- @SuppressWarnings("deprecation")
- public SerializedView saveSerializedView(FacesContext context) {
- // delegate to enclosed class method.
- Object[] viewState = buildViewState(context);
- return new SerializedView(viewState[0],viewState[1]);
- }
-
- @Override
- public Object saveView(FacesContext context) {
- // TODO Auto-generated method stub
- return buildViewState(context);
- }
- @SuppressWarnings("deprecation")
- public void writeState(FacesContext arg0, SerializedView arg1)
- throws IOException {
- // do nothing
- }
- }
-
- private static final Class<StateManager> STATE_MANAGER_ARGUMENTS =
StateManager.class;
-
- public static final int DEFAULT_NUMBER_OF_VIEWS = 16;
-
- public static final String AJAX_VIEW_SEQUENCE = AjaxStateManager.class.getName()
- + ".AJAX_VIEW_SEQUENCE";
- public static final String VIEW_SEQUENCE = AjaxStateManager.class.getName()
- + ".VIEW_SEQUENCE";
-
- private final StateManager parent;
-
- private StateManager seamStateManager;
-
- private final ComponentsLoader componentLoader;
-
- private static final Log _log = LogFactory.getLog(AjaxStateManager.class);
-
- public static final String VIEW_SEQUENCE_ATTRIBUTE = AjaxStateManager.class
- .getName()
- + ".view_sequence";
-
- /**
- * @param parent
- */
- public AjaxStateManager(StateManager parent) {
- super();
- this.parent = parent;
- componentLoader = new ComponentsLoaderImpl();
- // HACK - Seam perform significant operations before save tree state.
- // Try to create it instance by reflection,
- // to call in real state saving operations.
- ClassLoader classLoader = Thread.currentThread()
- .getContextClassLoader();
- if (null == classLoader) {
- classLoader = AjaxStateManager.class.getClassLoader();
- }
- try {
- Class<? extends StateManager> seamStateManagerClass = classLoader
- .loadClass("org.jboss.seam.jsf.SeamStateManager")
- .asSubclass(StateManager.class);
- Constructor<? extends StateManager> constructor = seamStateManagerClass
- .getConstructor(STATE_MANAGER_ARGUMENTS);
- seamStateManager = constructor
- .newInstance(new Object[] { new SeamStateManagerWrapper() });
- if (_log.isDebugEnabled()) {
- _log.debug("Create instance of the SeamStateManager");
- }
- } catch (Exception e) {
- seamStateManager = null;
- if (_log.isDebugEnabled()) {
- _log.debug("SeamStateManager is not present");
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
javax.faces.application.StateManager#getComponentStateToSave(javax.faces.context.FacesContext)
- */
- protected Object getComponentStateToSave(FacesContext context) {
- Object treeState = context.getViewRoot().processSaveState(context);
- Object state[] = { treeState, getAdditionalState(context) };
- return state;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
javax.faces.application.StateManager#getTreeStructureToSave(javax.faces.context.FacesContext)
- */
- protected Object getTreeStructureToSave(FacesContext context) {
- TreeStructureNode treeStructure = new TreeStructureNode();
- treeStructure.apply(context, context.getViewRoot(),
- new HashSet<String>());
- return treeStructure;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
javax.faces.application.StateManager#restoreComponentState(javax.faces.context.FacesContext,
- * javax.faces.component.UIViewRoot, java.lang.String)
- */
- protected void restoreComponentState(FacesContext context,
- UIViewRoot viewRoot, String renderKitId) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
javax.faces.application.StateManager#restoreTreeStructure(javax.faces.context.FacesContext,
- * java.lang.String, java.lang.String)
- */
- protected UIViewRoot restoreTreeStructure(FacesContext context,
- String viewId, String renderKitId) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
javax.faces.application.StateManager#writeState(javax.faces.context.FacesContext,
- * javax.faces.application.StateManager.SerializedView)
- */
- public void writeState(FacesContext context, Object state)
- throws IOException {
- RenderKit renderKit = getRenderKit(context);
- ResponseStateManager responseStateManager = renderKit
- .getResponseStateManager();
- Object[] stateArray = getStateArray( state );
- if(null == stateArray[0] && null == stateArray[1]){
- // Myfaces
https://issues.apache.org/jira/browse/MYFACES-1753 hack.
- stateArray=new Object[]{getLogicalViewId(context),null};
- }
- writeState(context, responseStateManager, stateArray);
- if (_log.isDebugEnabled()) {
- _log.debug("Write view state to the response");
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
javax.faces.application.StateManager#writeState(javax.faces.context.FacesContext,
- * javax.faces.application.StateManager.SerializedView)
- */
- @SuppressWarnings("deprecation")
- public void writeState(FacesContext context, SerializedView state)
- throws IOException {
- RenderKit renderKit = getRenderKit(context);
- ResponseStateManager responseStateManager = renderKit
- .getResponseStateManager();
- Object[] stateArray;
- if(null == state.getState() && null == state.getStructure()){
- // MyFaces
https://issues.apache.org/jira/browse/MYFACES-1753 hack
- stateArray = new Object[]{getLogicalViewId(context),null};
- } else {
- stateArray = new Object[] {
- state.getStructure(),state.getState() };
- }
- writeState(context, responseStateManager, stateArray);
- if (_log.isDebugEnabled()) {
- _log.debug("Write view state to the response");
- }
- }
-
- /**
- * @param context
- * @param state
- * @param responseStateManager
- * @throws IOException
- * @throws FacesException
- */
- private Object[] getStateArray(Object state) throws IOException,
- FacesException {
- if (null != state && state.getClass().isArray()
- && state.getClass().getComponentType().equals(Object.class)) {
- Object stateArray[] = (Object[]) state;
- if (2 == stateArray.length) {
- return stateArray;
- } else {
- throw new FacesException("Unexpected length of the state object array
"+stateArray.length);
- }
- } else {
- throw new FacesException("Unexpected type of the state
"+state.getClass().getName());
- }
- }
-
- private void writeState(FacesContext context,
- ResponseStateManager responseStateManager, Object[] stateArray)
- throws IOException {
- // Capture writed state into string.
- ResponseWriter originalWriter = context.getResponseWriter();
- StringWriter buff = new StringWriter(128);
- try {
- ResponseWriter stateResponseWriter = originalWriter
- .cloneWithWriter(buff);
- context.setResponseWriter(stateResponseWriter);
- responseStateManager.writeState(context, stateArray);
- stateResponseWriter.flush();
- String stateString = buff.toString();
- originalWriter.write(stateString);
- String stateValue = getStateValue(stateString);
- context.getExternalContext().getRequestMap().put(CAPTURED_VIEW_STATE, stateValue);
- if (null != stateValue) {
- } else {
- }
- } finally {
- context.setResponseWriter(originalWriter);
- }
- }
-
- private static final Pattern PATTERN =
Pattern.compile(".*<input.*(?:\\svalue=[\"\'](.*)[\"\']\\s).*name=[\"']"+ResponseStateManager.VIEW_STATE_PARAM+"[\"'].*>");
-
- private static final Pattern PATTERN2 = Pattern.compile(".*<input
.*name=[\"']"+ResponseStateManager.VIEW_STATE_PARAM+"[\"'].*(?:\\svalue=[\"\'](.*)[\"\']\\s).*>");
-
-
- /**
- * Parse content of the writed viewState hidden input field for a state value.
- * @param input
- * @return
- */
- private String getStateValue(String input) {
- Matcher matcher = PATTERN.matcher(input);
- if(!matcher.matches()){
- matcher = PATTERN2.matcher(input);
- if(!matcher.matches()){
- return null;
- }
- }
- return matcher.group(1);
-}
-
- private static final Map<String,Class<?>> PRIMITIVE_CLASSES =
- new HashMap<String,Class<?>>(9, 1.0F);
-
- static {
- PRIMITIVE_CLASSES.put("boolean", boolean.class);
- PRIMITIVE_CLASSES.put("byte", byte.class);
- PRIMITIVE_CLASSES.put("char", char.class);
- PRIMITIVE_CLASSES.put("short", short.class);
- PRIMITIVE_CLASSES.put("int", int.class);
- PRIMITIVE_CLASSES.put("long", long.class);
- PRIMITIVE_CLASSES.put("float", float.class);
- PRIMITIVE_CLASSES.put("double", double.class);
- PRIMITIVE_CLASSES.put("void", void.class);
- }
-
- private static final Object handleRestoreState(FacesContext context, Object state) {
- if (ContextInitParameters.isSerializeServerState(context)) {
- ObjectInputStream ois = null;
- try {
- ois = new ObjectInputStream(new ByteArrayInputStream((byte[]) state)) {
- @Override
- protected Class<?> resolveClass(ObjectStreamClass desc)
- throws IOException, ClassNotFoundException {
- String name = desc.getName();
- try {
- return Class.forName(name, true,
- Thread.currentThread().getContextClassLoader());
- } catch (ClassNotFoundException cnfe) {
- Class<?> clazz = PRIMITIVE_CLASSES.get(name);
- if (clazz != null) {
- return clazz;
- } else {
- throw cnfe;
- }
- }
- }
- };
- return ois.readObject();
- } catch (Exception e) {
- throw new FacesException(e);
- } finally {
- if (ois != null) {
- try {
- ois.close();
- } catch (IOException ignored) { }
- }
- }
- } else {
- return state;
- }
- }
-
- private static final Object handleSaveState(FacesContext context, Object state) {
- if (ContextInitParameters.isSerializeServerState(context)) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- ObjectOutputStream oas = null;
- try {
- oas = new ObjectOutputStream(baos);
- oas.writeObject(state);
- oas.flush();
- } catch (Exception e) {
- throw new FacesException(e);
- } finally {
- if (oas != null) {
- try {
- oas.close();
- } catch (IOException ignored) { }
- }
- }
- return baos.toByteArray();
- } else {
- return state;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
javax.faces.application.StateManager#restoreView(javax.faces.context.FacesContext,
- * java.lang.String, java.lang.String)
- */
- public UIViewRoot restoreView(FacesContext context, String viewId,
- String renderKitId) {
- UIViewRoot viewRoot = null;
- ResponseStateManager responseStateManager = getRenderKit(context,
- renderKitId).getResponseStateManager();
- TreeStructureNode treeStructure = null;
- Object[] state = null;
- Object[] serializedView = null;
- if (isSavingStateInClient(context)) {
- serializedView = (Object[]) responseStateManager.getState(context,
- viewId);
-
- if (null != serializedView) {
- treeStructure = (TreeStructureNode) serializedView[0];
- state = (Object[]) serializedView[1];
- }
- } else {
- serializedView = restoreStateFromSession(context, viewId,
- renderKitId);
-
- if (null != serializedView) {
- treeStructure = (TreeStructureNode) serializedView[0];
- state = (Object[]) handleRestoreState(context, serializedView[1]);
- }
- }
-
- if (null != treeStructure) {
- viewRoot = (UIViewRoot) treeStructure.restore(componentLoader);
- if (null != viewRoot && null != state) {
- viewRoot.processRestoreState(context, state[0]);
- restoreAdditionalState(context, state[1]);
- }
- }
- return viewRoot;
-
- }
-
- @SuppressWarnings("deprecation")
- public SerializedView saveSerializedView(FacesContext context) {
- Object[] stateViewArray;
- if (null == seamStateManager) {
- stateViewArray = buildViewState(context);
- } else {
- // Delegate save method to seam State Manager.
- stateViewArray=(Object[]) seamStateManager.saveView(context);
- }
- return new SerializedView(stateViewArray[0],stateViewArray[1]);
- }
-
- @Override
- public Object saveView(FacesContext context) {
- if (null == seamStateManager) {
- return buildViewState(context);
- } else {
- // Delegate save method to seam State Manager.
- return seamStateManager.saveView(context);
- }
- }
- /**
- * @param context
- * @return
- * @see
javax.faces.application.StateManager#isSavingStateInClient(javax.faces.context.FacesContext)
- */
- public boolean isSavingStateInClient(FacesContext context) {
- return parent.isSavingStateInClient(context);
- }
-
- protected Object[] restoreStateFromSession(FacesContext context,
- String viewId, String renderKitId) {
- String id = restoreLogicalViewId(context, viewId, renderKitId);
- StateHolder stateHolder = getStateHolder(context);
- Object[] restoredState = stateHolder.getState(context, viewId, id);
-
- if (restoredState != null && id != null) {
- context.getExternalContext().getRequestMap().put(AJAX_VIEW_SEQUENCE, id);
- }
-
- return restoredState;
- }
-
- /**
- * @param context
- * @return
- */
- protected Object[] buildViewState(FacesContext context) {
- Object[] viewStateArray = null;
- UIViewRoot viewRoot = context.getViewRoot();
- if (null != viewRoot && !viewRoot.isTransient()) {
- TreeStructureNode treeStructure = (TreeStructureNode)
getTreeStructureToSave(context);
- Object state = getComponentStateToSave(context);
- if (isSavingStateInClient(context)) {
- viewStateArray = new Object[]{treeStructure, state};
- } else {
- viewStateArray = saveStateInSession(context, treeStructure,
- handleSaveState(context, state));
- }
-
- }
- return viewStateArray;
- }
-
- /**
- * @param context
- * @param treeStructure
- * @param state
- * @return
- */
- protected Object[] saveStateInSession(FacesContext context,
- Object treeStructure, Object state) {
- Object[] serializedView;
- UIViewRoot viewRoot = context.getViewRoot();
- StateHolder stateHolder = getStateHolder(context);
- String id = getLogicalViewId(context);
- stateHolder.saveState(context, viewRoot.getViewId(), id, new Object[] {
- treeStructure, state });
- serializedView = new Object[]{id, null};
- return serializedView;
- }
-
- /**
- * @param context
- * @return
- */
- protected StateHolder getStateHolder(FacesContext context) {
- return AjaxStateHolder.getInstance(context);
- }
-
- protected Object getAdditionalState(FacesContext context) {
- Map<String, Object> keepAliveBeans = new HashMap<String, Object>();
- Map<String, Object> requestMap = context.getExternalContext()
- .getRequestMap();
- // Save all objects form request map wich marked by @KeepAlive
- // annotations
- for (Entry<String, Object> requestEntry : requestMap.entrySet()) {
- Object bean = requestEntry.getValue();
- // check value for a NULL -
- //
http://jira.jboss.com/jira/browse/RF-3576
- if (null != bean
- && bean.getClass().isAnnotationPresent(KeepAlive.class)) {
- keepAliveBeans.put(requestEntry.getKey(), bean);
- }
- }
- if (keepAliveBeans.size() > 0) {
- return UIComponentBase.saveAttachedState(context, keepAliveBeans);
- } else {
- return null;
- }
- }
-
- @SuppressWarnings("unchecked")
- protected void restoreAdditionalState(FacesContext context, Object state) {
- if (null != state) {
- boolean isAjax = AjaxContext.getCurrentInstance(context).isAjaxRequest();
-
- // Append all saved beans to the request map.
- Map beansMap = (Map) UIComponentBase.restoreAttachedState(context,
- state);
- Map<String, Object> requestMap = context.getExternalContext()
- .getRequestMap();
- for (Object key : beansMap.keySet()) {
- Object bean = beansMap.get(key);
- if (bean != null) {
- KeepAlive annotation = bean.getClass().getAnnotation(KeepAlive.class);
- if (annotation != null) {
- if (!isAjax && annotation.ajaxOnly()) {
-
- //skip ajax-only beans for non-ajax requests
- continue;
- }
- }
- }
-
- requestMap.put((String) key, bean);
- }
- }
- }
-
- /**
- * Restore logical view id from request.
- *
- * @param context
- * @param viewId
- * @param renderKitId
- * @return
- */
- @SuppressWarnings("deprecation")
- protected String restoreLogicalViewId(FacesContext context, String viewId,
- String renderKitId) {
- String id = (String) getRenderKit(context, renderKitId)
- .getResponseStateManager().getTreeStructureToRestore(context,
- viewId);
- return id;
- }
-
- /**
- * Return logical Id for current request view state. For a faces requests,
- * generate sequence numbers. For a ajax request, attempt to re-use id from
- * request submit.
- *
- * @param context
- * @return
- */
- protected String getLogicalViewId(FacesContext context) {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- ExternalContext externalContext = context.getExternalContext();
- Object id=null;
- Map<String, Object> requestMap = externalContext.getRequestMap();
- id = requestMap.get(ajaxContext.isAjaxRequest()?AJAX_VIEW_SEQUENCE:VIEW_SEQUENCE);
- if (null != id) {
- return id.toString();
- }
- // Store sequence in session, to avoyd claster configuration problem
- // see
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=662
- Object session = externalContext.getSession(true);
- int viewSequence;
- synchronized (session) {
- Map<String, Object> sessionMap = externalContext.getSessionMap();
- Integer sequence = (Integer) sessionMap
- .get(VIEW_SEQUENCE_ATTRIBUTE);
- if (null != sequence) {
- viewSequence = sequence.intValue();
- } else {
- viewSequence = 0;
- }
- if (viewSequence++ == Character.MAX_VALUE) {
- viewSequence = 0;
- }
- sessionMap.put(VIEW_SEQUENCE_ATTRIBUTE, new Integer(viewSequence));
- }
- String logicalViewId = UIViewRoot.UNIQUE_ID_PREFIX + ((int) viewSequence);
- // Store new viewId in the request parameters, to avoid re-increments in the same
request.
- requestMap.put(VIEW_SEQUENCE,logicalViewId);
- return logicalViewId;
- }
-
- protected RenderKit getRenderKit(FacesContext context) {
- String renderKitId = null;
- UIViewRoot viewRoot = context.getViewRoot();
- if (null != viewRoot) {
- renderKitId = viewRoot.getRenderKitId();
- }
- if (null == renderKitId) {
- renderKitId = context.getApplication().getViewHandler()
- .calculateRenderKitId(context);
- }
- return getRenderKit(context, renderKitId);
- }
-
- protected RenderKit getRenderKit(FacesContext context, String renderKitId) {
- RenderKit renderKit = context.getRenderKit();
- if (null == renderKit) {
- RenderKitFactory factory = (RenderKitFactory) FactoryFinder
- .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
- renderKit = factory.getRenderKit(context, renderKitId);
- }
- return renderKit;
- }
-
-}
Deleted:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/ComponentsLoader.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/ComponentsLoader.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/ComponentsLoader.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -1,29 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.application;
-
-import javax.faces.component.UIComponent;
-
-public interface ComponentsLoader {
-
- public abstract UIComponent createComponent(String type);
-
-}
\ No newline at end of file
Deleted:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/ComponentsLoaderImpl.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/ComponentsLoaderImpl.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/ComponentsLoaderImpl.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -1,83 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.application;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-
-/**
- * @author asmirnov
- *
- */
-public class ComponentsLoaderImpl implements ComponentsLoader {
-
- private Map<String, Class<? extends UIComponent>> classes;
-
- private ClassLoader loader;
-
- public ComponentsLoaderImpl() {
- classes = new ConcurrentHashMap<String, Class<? extends UIComponent>>(
- 64);
- loader = Thread.currentThread().getContextClassLoader();
- if (loader == null) {
- loader = ComponentsLoaderImpl.class.getClassLoader();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.ajax4jsf.portlet.application.ComponentsLoader#createComponent(java
- * .lang.String)
- */
- public UIComponent createComponent(String type) {
- // Classes is a lazy Map, new object will be create on the fly.
- Class<? extends UIComponent> componentClass = classes.get(type);
- if(null == componentClass){
- try {
- componentClass = loader.loadClass(type).asSubclass(UIComponent.class);
- classes.put(type, componentClass);
- } catch (ClassNotFoundException e) {
- throw new FacesException("Can't load class " + type, e);
- }
-
- }
- try {
- return componentClass.newInstance();
- } catch (InstantiationException e) {
- throw new FacesException(
- "Error on create new instance of the component with class "
- + type, e);
- } catch (IllegalAccessException e) {
- throw new FacesException(
- "IllegalAccess on attempt to create new instance of the component with class
"
- + type, e);
- }
- }
-
- ClassLoader getClassLoader() {
- return loader;
- }
-}
Deleted:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/TreeStructureNode.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/TreeStructureNode.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/application/TreeStructureNode.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -1,264 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.ajax4jsf.application;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-/**
- * @author asmirnov
- *
- */
-final class TreeStructureNode implements Externalizable {
- /**
- * TODO - implement Externalizable to reduce serialized state.
- */
- private static final long serialVersionUID = -9038742487716977912L;
-
- private static final String NULL_ID = "";
-
- private List<FacetEntry> facets = null;
-
- private List<TreeStructureNode> children = null;
-
- private String type;
-
- private String id;
-
- public TreeStructureNode() {
- }
-
- public void apply(FacesContext context, UIComponent component,
- Set<String> uniqueIds) {
- type = component.getClass().getName();
- id = component.getId();
- String clientId = component.getClientId(context);
- if (!uniqueIds.add(clientId)) {
- throw new IllegalStateException("duplicate Id for a component "
- + clientId);
- }
- Map<String, UIComponent> componentFacets = component.getFacets();
- for (Iterator<Entry<String, UIComponent>> i = componentFacets
- .entrySet().iterator(); i.hasNext();) {
- Entry<String, UIComponent> element = i.next();
- UIComponent f = element.getValue();
- if (!f.isTransient()) {
- TreeStructureNode facet = new TreeStructureNode();
- facet.apply(context, f, uniqueIds);
- if (null == facets) {
- facets = new ArrayList<FacetEntry>(componentFacets.size());
- }
- facets.add(new FacetEntry(element.getKey(), facet));
-
- }
- }
- List<UIComponent> componentChildren = component.getChildren();
- for (Iterator<UIComponent> i = componentChildren.iterator(); i
- .hasNext();) {
- UIComponent child = i.next();
- if (!child.isTransient()) {
- TreeStructureNode t = new TreeStructureNode();
- t.apply(context, child, uniqueIds);
- if (null == children) {
- children = new ArrayList<TreeStructureNode>(
- componentChildren.size());
- }
- children.add(t);
-
- }
- }
- }
-
- public UIComponent restore(ComponentsLoader loader) {
- UIComponent component;
- component = loader.createComponent(type);
- component.setId(id);
- if (null != facets) {
- for (Iterator<FacetEntry> i = facets.iterator(); i.hasNext();) {
- FacetEntry element = i.next();
- UIComponent facet = (element.getNode()).restore(loader);
- component.getFacets().put(element.getName(), facet);
- }
-
- }
- if (null != children) {
- for (Iterator<TreeStructureNode> i = children.iterator(); i
- .hasNext();) {
- TreeStructureNode node = i.next();
- UIComponent child = node.restore(loader);
- component.getChildren().add(child);
- }
-
- }
- return component;
- }
-
- /**
- * @return the facets
- */
- public List<FacetEntry> getFacets() {
- return facets;
- }
-
-
- /**
- * @return the children
- */
- public List<TreeStructureNode> getChildren() {
- return children;
- }
-
-
- /**
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * @param type
- * the type to set
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * @return the id
- */
- public String getId() {
- return id;
- }
-
- /**
- * @param id
- * the id to set
- */
- public void setId(String id) {
- this.id = id;
- }
-
- public void readExternal(ObjectInput in) throws IOException,
- ClassNotFoundException {
- type = in.readUTF();
- id = in.readUTF();
- if (NULL_ID.equals(id)) {
- id = null;
- }
- int facetsSize = in.readInt();
- if (facetsSize > 0) {
- facets = new ArrayList<FacetEntry>(facetsSize);
- for (int i = 0; i < facetsSize; i++) {
- String facetName = in.readUTF();
- TreeStructureNode facet = new TreeStructureNode();
- facet.readExternal(in);
- facets.add(new FacetEntry(facetName, facet));
- }
- }
- int childrenSize = in.readInt();
- if (childrenSize > 0) {
- children = new ArrayList<TreeStructureNode>(childrenSize);
- for (int i = 0; i < childrenSize; i++) {
- TreeStructureNode child = new TreeStructureNode();
- child.readExternal(in);
- children.add(child);
- }
- }
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF(type);
- out.writeUTF(null == id ? NULL_ID : id);
- if (null != facets) {
- out.writeInt(facets.size());
- for (Iterator<FacetEntry> i = facets.iterator(); i.hasNext();) {
- FacetEntry entry = i.next();
- out.writeUTF(entry.getName());
- TreeStructureNode node = entry.getNode();
- node.writeExternal(out);
- }
-
- } else {
- out.writeInt(0);
- }
- if (null != children) {
- out.writeInt(children.size());
- for (Iterator<TreeStructureNode> i = children.iterator(); i
- .hasNext();) {
- TreeStructureNode child = i.next();
- child.writeExternal(out);
- }
-
- } else {
- out.writeInt(0);
- }
- }
-
- @SuppressWarnings("serial")
- static final class FacetEntry implements Externalizable {
- private String name;
- private TreeStructureNode node;
-
- public String getName() {
- return name;
- }
-
- public TreeStructureNode getNode() {
- return node;
- }
-
- /**
- * @param name
- * @param node
- */
- public FacetEntry(String name, TreeStructureNode node) {
- super();
- this.name = name;
- this.node = node;
- }
-
- public void readExternal(ObjectInput in) throws IOException,
- ClassNotFoundException {
- this.name = in.readUTF();
- this.node = new TreeStructureNode();
- this.node.readExternal(in);
- }
-
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeUTF(name);
- node.writeExternal(out);
- }
- }
-}
\ No newline at end of file
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -25,8 +25,6 @@
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import org.ajax4jsf.application.AjaxStateManager;
-
/**
* This class hold all methods for get application init parameters. Created for
* single access point to all parameters - simplest for a documentation.
@@ -44,17 +42,6 @@
// parameters. Do not Instantiate !
}
- public static final String[] SERIALIZE_SERVER_STATE = new String[] {
- "org.ajax4jsf.SERIALIZE_SERVER_STATE",
-
- /* detect MyFaces vs. RI */
- "com.sun.faces.serializeServerState",
- "org.apache.myfaces.SERIALIZE_STATE_IN_SESSION"
- };
-
- public static final String[] NUMBER_OF_VIEWS_IN_SESSION =
{"com.sun.faces.numberOfViewsInSession"};
- public static final String[] NUMBER_OF_LOGICAL_VIEWS_IN_SESSION =
{"com.sun.faces.numberOfLogicalViews"};
-
/**
* This parameter define where {@link ViewExpiredException} should be handled.
* If is it equals "true" , framework should proparate exception to
client-side.
@@ -63,31 +50,7 @@
public static final String[] DATATABLE_USES_VIEW_LOCALE =
{"org.richfaces.datatableUsesViewLocale"};
- public static final boolean isSerializeServerState(FacesContext context) {
- return getBoolean(context, SERIALIZE_SERVER_STATE, false);
- }
-
/**
- * Get number of views for store in session by {@link AjaxStateManager}
- * @param context - current faces context.
- * @return
- */
- public static int getNumbersOfViewsInSession(FacesContext context) {
- return getInteger(context, NUMBER_OF_VIEWS_IN_SESSION,
- AjaxStateManager.DEFAULT_NUMBER_OF_VIEWS);
- }
-
- /**
- * Get number of logical views for store in session for every viewId by {@link
AjaxStateManager}
- * @param context - current faces context.
- * @return
- */
- public static int getNumbersOfLogicalViews(FacesContext context) {
- return getInteger(context, NUMBER_OF_LOGICAL_VIEWS_IN_SESSION,
- AjaxStateManager.DEFAULT_NUMBER_OF_VIEWS);
- }
-
- /**
* Defines whether data table should use view root locale for sorting and filtering or
the
* default platform one
*
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java
===================================================================
---
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/main/java/org/ajax4jsf/event/InitPhaseListener.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -25,7 +25,6 @@
import javax.faces.FactoryFinder;
import javax.faces.application.Application;
-import javax.faces.application.StateManager;
import javax.faces.application.ViewHandler;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
@@ -34,7 +33,6 @@
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
-import org.ajax4jsf.application.AjaxStateManager;
import org.ajax4jsf.application.AjaxViewHandler;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Deleted:
root/framework/trunk/impl/src/main/resources/org/ajax4jsf/webapp/output.properties
===================================================================
---
root/framework/trunk/impl/src/main/resources/org/ajax4jsf/webapp/output.properties 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/main/resources/org/ajax4jsf/webapp/output.properties 2009-07-23
17:23:34 UTC (rev 14992)
@@ -1,4 +0,0 @@
-method = xml
-omit-xml-declaration = no
-doctype-public = -//W3C//DTD XHTML 1.0 Transitional//EN
-doctype-system =
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
\ No newline at end of file
Modified:
root/framework/trunk/impl/src/test/java/org/ajax4jsf/context/InitParametersTest.java
===================================================================
---
root/framework/trunk/impl/src/test/java/org/ajax4jsf/context/InitParametersTest.java 2009-07-23
17:22:34 UTC (rev 14991)
+++
root/framework/trunk/impl/src/test/java/org/ajax4jsf/context/InitParametersTest.java 2009-07-23
17:23:34 UTC (rev 14992)
@@ -5,7 +5,6 @@
import javax.faces.FacesException;
-import org.ajax4jsf.application.AjaxStateManager;
import org.richfaces.test.AbstractFacesTest;
/**
@@ -49,20 +48,6 @@
}
/**
- * Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getNumbersOfViewsInSession(javax.faces.context.FacesContext)}.
- */
- public void testGetNumbersOfViewsInSession() {
- assertEquals(AjaxStateManager.DEFAULT_NUMBER_OF_VIEWS,
ContextInitParameters.getNumbersOfViewsInSession(facesContext));
- }
-
- /**
- * Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getNumbersOfLogicalViews(javax.faces.context.FacesContext)}.
- */
- public void testGetNumbersOfLogicalViews() {
- assertEquals(AjaxStateManager.DEFAULT_NUMBER_OF_VIEWS,
ContextInitParameters.getNumbersOfLogicalViews(facesContext));
- }
-
- /**
* Test method for {@link
org.ajax4jsf.context.ContextInitParameters#getInteger(javax.faces.context.FacesContext,
java.lang.String[], int)}.
*/
public void testGetInteger() {