You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/10/13 19:42:40 UTC
svn commit: r824859 [1/4] - in /myfaces: core/trunk/api/
core/trunk/api/src/main/java/javax/faces/component/
core/trunk/api/src/main/java/javax/faces/validator/
core/trunk/api/src/main/java/javax/faces/webapp/ core/trunk/impl/
core/trunk/impl/src/main/...
Author: lu4242
Date: Tue Oct 13 17:42:36 2009
New Revision: 824859
URL: http://svn.apache.org/viewvc?rev=824859&view=rev
Log:
MYFACES-2378 Use java util logging on 2.0.x branch
Modified:
myfaces/core/trunk/api/pom.xml
myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java
myfaces/core/trunk/api/src/main/java/javax/faces/component/_ClassUtils.java
myfaces/core/trunk/api/src/main/java/javax/faces/component/_ValueBindingToValueExpression.java
myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java
myfaces/core/trunk/api/src/main/java/javax/faces/webapp/FacesServlet.java
myfaces/core/trunk/api/src/main/java/javax/faces/webapp/PreJsf2ExceptionHandlerFactory.java
myfaces/core/trunk/api/src/main/java/javax/faces/webapp/_ErrorPageWriter.java
myfaces/core/trunk/impl/pom.xml
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/ManagedBeanBuilder.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/RuntimeConfig.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/AnnotationConfigurator.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/DefaultLifecycleProviderFactory.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/TomcatAnnotationLifecycleProvider.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/_PackageInfo.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/impl/FacesConfigEntityResolver.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/FacesContextFactoryImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/servlet/ServletExternalContextImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/convert/ValueBindingToValueExpression.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/el/unified/resolver/ManagedBeanResolver.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/LifecycleImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/RenderKitFactoryImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCompositeComponentRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCompositeFacetRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlFormatRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlLabelRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlRenderKitImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlResponseStateManager.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlScriptRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlStylesheetRenderer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/taglib/core/PhaseListenerTag.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/taglib/core/SetPropertyActionListenerTag.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/taglib/core/ViewTag.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/util/DebugUtils.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/CompilationManager.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/Compiler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFacelet.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/DefaultFaceletFactory.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/MetaRulesetImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttachedObjectTargetHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/AttributeHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentRule.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/CompositeMetaRulesetImpl.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ExtensionHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/FacetHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/composite/ImplementationHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentRule.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/CompositionHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/ui/DecorateHandler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/util/Resource.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/jsp/JspViewDeclarationLanguage.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/AbstractMyFacesListener.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/Jsp20FacesInitializer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/Jsp21FacesInitializer.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/MyFacesServlet.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/webapp/StartupServletContextListener.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/config/Myfaces889TestCase.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/test/AbstractClassElementTestCase.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/mock/MockServletContext.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/_SharedRendererUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessagesRendererBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/JavascriptUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/taglib/UIComponentBodyELTagBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/taglib/UIComponentBodyTagBase.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/taglib/UIComponentELTagUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/taglib/UIComponentTagUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/util/ClassUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/util/LocaleUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/util/MessageUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/util/RestoreStateUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/util/StateUtils.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/util/xml/MyFacesErrorHandler.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXml.java
myfaces/shared/trunk_4.0.x/core/src/main/java/org/apache/myfaces/shared/webapp/webxml/WebXmlParser.java
myfaces/shared/trunk_4.0.x/pom.xml
Modified: myfaces/core/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/pom.xml?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/api/pom.xml (original)
+++ myfaces/core/trunk/api/pom.xml Tue Oct 13 17:42:36 2009
@@ -342,11 +342,11 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
+ <!-- dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
- </dependency>
+ </dependency -->
<dependency>
<groupId>org.apache.myfaces.buildtools</groupId>
<artifactId>myfaces-builder-annotations</artifactId>
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIComponentBase.java Tue Oct 13 17:42:36 2009
@@ -28,6 +28,8 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.el.ValueExpression;
import javax.faces.FacesException;
@@ -50,12 +52,11 @@
import javax.faces.render.RenderKitFactory;
import javax.faces.render.Renderer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspProperty;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
/**
* TODO: IMPLEMENT HERE - Delta state saving support
*
@@ -75,7 +76,8 @@
@JSFJspProperty(name = "binding", returnType = "javax.faces.component.UIComponent", longDesc = "Identifies a backing bean property (of type UIComponent or appropriate subclass) to bind to this component instance. This value must be an EL expression.", desc = "backing bean property to bind to this component instance")
public abstract class UIComponentBase extends UIComponent
{
- private static Log log = LogFactory.getLog(UIComponentBase.class);
+ //private static Log log = LogFactory.getLog(UIComponentBase.class);
+ private static Logger log = Logger.getLogger(UIComponentBase.class.getName());
private static final ThreadLocal<StringBuilder> _STRING_BUILDER = new ThreadLocal<StringBuilder>();
@@ -341,9 +343,9 @@
{
//component didn't implement getEventNames properly
//log an error and return
- if(log.isErrorEnabled())
+ if(log.isLoggable(Level.SEVERE))
{
- log.error("attempted to add a behavior to a component which did not properly implement getEventNames. getEventNames must not return null");
+ log.severe("attempted to add a behavior to a component which did not properly implement getEventNames. getEventNames must not return null");
return;
}
}
@@ -821,9 +823,9 @@
_clientId = renderer.convertClientId(context, _clientId);
}
- if (idWasNull && log.isWarnEnabled())
+ if (idWasNull && log.isLoggable(Level.WARNING))
{
- log.warn("WARNING: Component " + _clientId
+ log.warning("WARNING: Component " + _clientId
+ " just got an automatic id, because there was no id assigned yet. "
+ "If this component was created dynamically (i.e. not by a JSP tag) you should assign it an "
+ "explicit static id or assign it the id you get from "
@@ -1115,7 +1117,7 @@
"No Renderer found for component " + getPathToComponent(this)
+ " (component-family=" + getFamily()
+ ", renderer-type=" + rendererType + ")");
- log.warn("No Renderer found for component " + getPathToComponent(this) + " (component-family="
+ log.warning("No Renderer found for component " + getPathToComponent(this) + " (component-family="
+ getFamily() + ", renderer-type=" + rendererType + ")");
}
return renderer;
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/_ClassUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/_ClassUtils.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/_ClassUtils.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/_ClassUtils.java Tue Oct 13 17:42:36 2009
@@ -31,14 +31,13 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.el.ExpressionFactory;
import javax.faces.FacesException;
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* @author Manfred Geiler (latest modification by $Author$)
* @author Anton Koinov
@@ -48,7 +47,8 @@
{
// ~ Static fields/initializers -----------------------------------------------------------------
- private static final Log log = LogFactory.getLog(_ClassUtils.class);
+ //private static final Log log = LogFactory.getLog(_ClassUtils.class);
+ private static final Logger log = Logger.getLogger(_ClassUtils.class.getName());
public static final Class<boolean[]> BOOLEAN_ARRAY_CLASS = boolean[].class;
public static final Class<byte[]> BYTE_ARRAY_CLASS = byte[].class;
@@ -168,7 +168,7 @@
}
catch (ClassNotFoundException e)
{
- log.error("Class " + type + " not found", e);
+ log.log(Level.SEVERE, "Class " + type + " not found", e);
throw new FacesException(e);
}
}
@@ -227,7 +227,7 @@
}
catch (ClassNotFoundException e)
{
- log.error("Class " + type + " not found", e);
+ log.log(Level.SEVERE, "Class " + type + " not found", e);
throw new FacesException(e);
}
}
@@ -264,7 +264,7 @@
}
catch (IOException e)
{
- log.error(e.getMessage(), e);
+ log.log(Level.SEVERE, e.getMessage(), e);
throw new FacesException(e);
}
}
@@ -311,17 +311,17 @@
}
catch (NoClassDefFoundError e)
{
- log.error("Class : " + clazz.getName() + " not found.", e);
+ log.log(Level.SEVERE, "Class : " + clazz.getName() + " not found.", e);
throw new FacesException(e);
}
catch (InstantiationException e)
{
- log.error(e.getMessage(), e);
+ log.log(Level.SEVERE, e.getMessage(), e);
throw new FacesException(e);
}
catch (IllegalAccessException e)
{
- log.error(e.getMessage(), e);
+ log.log(Level.SEVERE, e.getMessage(), e);
throw new FacesException(e);
}
}
@@ -339,7 +339,7 @@
catch (Exception e)
{
String message = "Cannot coerce " + value.getClass().getName() + " to " + desiredClass.getName();
- log.error(message, e);
+ log.log(Level.SEVERE, message, e);
throw new FacesException(message, e);
}
}
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/_ValueBindingToValueExpression.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/_ValueBindingToValueExpression.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/_ValueBindingToValueExpression.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/_ValueBindingToValueExpression.java Tue Oct 13 17:42:36 2009
@@ -19,6 +19,9 @@
package javax.faces.component;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
import javax.el.ELContext;
import javax.el.ELException;
import javax.el.PropertyNotFoundException;
@@ -28,8 +31,6 @@
import javax.faces.el.EvaluationException;
import javax.faces.el.ValueBinding;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
/**
* Wraps a ValueBinding inside a ValueExpression. Also allows access to the original ValueBinding object.
@@ -45,7 +46,8 @@
{
private static final long serialVersionUID = 8071429285360496554L;
- private static final Log logger = LogFactory.getLog(_ValueBindingToValueExpression.class);
+ //private static final Log logger = LogFactory.getLog(_ValueBindingToValueExpression.class);
+ private static final Logger logger = Logger.getLogger(_ValueBindingToValueExpression.class.getName());
private ValueBinding _valueBinding;
@@ -193,7 +195,7 @@
}
catch (Throwable e)
{
- logger.warn("Could not determine expected type for '" + _valueBinding.getExpressionString() + "': "
+ logger.log(Level.WARNING, "Could not determine expected type for '" + _valueBinding.getExpressionString() + "': "
+ e.getMessage(), e);
}
}
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/validator/BeanValidator.java Tue Oct 13 17:42:36 2009
@@ -18,13 +18,21 @@
*/
package javax.faces.validator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspProperty;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFValidator;
-
-import javax.el.*;
+import java.beans.FeatureDescriptor;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.el.ELContext;
+import javax.el.ELResolver;
+import javax.el.FunctionMapper;
+import javax.el.ValueExpression;
+import javax.el.VariableMapper;
import javax.faces.FacesException;
import javax.faces.application.FacesMessage;
import javax.faces.component.PartialStateHolder;
@@ -37,8 +45,10 @@
import javax.validation.ValidatorFactory;
import javax.validation.groups.Default;
import javax.validation.metadata.BeanDescriptor;
-import java.beans.FeatureDescriptor;
-import java.util.*;
+
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspProperty;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFValidator;
/**
* <p>
@@ -61,7 +71,8 @@
public class BeanValidator implements Validator, PartialStateHolder
{
- private static final Log log = LogFactory.getLog(BeanValidator.class);
+ //private static final Log log = LogFactory.getLog(BeanValidator.class);
+ private static final Logger log = Logger.getLogger(BeanValidator.class.getName());
/**
* Converter ID, as defined by the JSF 2.0 specification.
@@ -130,14 +141,14 @@
}
catch (Throwable t)
{
- log.debug("Error initializing Bean Validation (could be normal)", t);
+ log.log(Level.FINE, "Error initializing Bean Validation (could be normal)", t);
tmp = false;
}
}
}
catch (Throwable t)
{
- log.debug("Error loading class (could be normal)", t);
+ log.log(Level.FINE, "Error loading class (could be normal)", t);
tmp = false;
}
isAvailable = tmp;
@@ -159,7 +170,7 @@
}
catch (Throwable t)
{
- log.debug("Error loading class (could be normal)", t);
+ log.log(Level.FINE, "Error loading class (could be normal)", t);
tmp = false;
}
isUnifiedELAvailable = tmp;
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/webapp/FacesServlet.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/webapp/FacesServlet.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/webapp/FacesServlet.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/webapp/FacesServlet.java Tue Oct 13 17:42:36 2009
@@ -23,6 +23,8 @@
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
@@ -39,9 +41,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
*
@@ -50,7 +49,8 @@
*/
public final class FacesServlet implements Servlet
{
- private static final Log log = LogFactory.getLog(FacesServlet.class);
+ //private static final Log log = LogFactory.getLog(FacesServlet.class);
+ private static final Logger log = Logger.getLogger(FacesServlet.class.getName());
public static final String CONFIG_FILES_ATTR = "javax.faces.CONFIG_FILES";
public static final String LIFECYCLE_ID_ATTR = "javax.faces.LIFECYCLE_ID";
@@ -73,8 +73,8 @@
_servletConfig = null;
_facesContextFactory = null;
_lifecycle = null;
- if (log.isTraceEnabled())
- log.trace("destroy");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("destroy");
}
public ServletConfig getServletConfig()
@@ -100,8 +100,8 @@
public void init(ServletConfig servletConfig) throws ServletException
{
- if (log.isTraceEnabled())
- log.trace("init begin");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("init begin");
_servletConfig = servletConfig;
_facesContextFactory = (FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
// TODO: null-check for Weblogic, that tries to initialize Servlet before ContextListener
@@ -111,8 +111,8 @@
// So we can acquire it here once:
LifecycleFactory lifecycleFactory = (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
_lifecycle = lifecycleFactory.getLifecycle(getLifecycleId());
- if (log.isTraceEnabled())
- log.trace("init end");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("init end");
}
public void service(ServletRequest request, ServletResponse response) throws IOException, ServletException
@@ -145,7 +145,7 @@
buffer.append("\n remote user is ").append(httpRequest.getRemoteUser());
buffer.append("\n request URI is ").append(httpRequest.getRequestURI());
- log.warn(buffer.toString());
+ log.warning(buffer.toString());
// Why does RI return a 404 and not a 403, SC_FORBIDDEN ?
@@ -155,8 +155,8 @@
// If none of the cases described above in the specification for this method apply to the servicing of this
// request, the following action must be taken to service the request.
- if (log.isTraceEnabled())
- log.trace("service begin");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("service begin");
// Acquire a FacesContext instance for this request.
FacesContext facesContext = prepareFacesContext(request, response);
@@ -195,8 +195,8 @@
// In a finally block, FacesContext.release() must be called.
facesContext.release();
}
- if (log.isTraceEnabled())
- log.trace("service end");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("service end");
}
/**
@@ -322,7 +322,7 @@
catch (NoSuchMethodException ex)
{
log
- .error(
+ .log(Level.SEVERE,
"Error-Handler : "
+ errorHandlerClass
+ " did not have a method with name : handleException and parameters : javax.faces.context.FacesContext, java.lang.Exception. Error-Handler is specified in web.xml-parameter : "
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/webapp/PreJsf2ExceptionHandlerFactory.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/webapp/PreJsf2ExceptionHandlerFactory.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/webapp/PreJsf2ExceptionHandlerFactory.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/webapp/PreJsf2ExceptionHandlerFactory.java Tue Oct 13 17:42:36 2009
@@ -21,6 +21,8 @@
import java.util.ArrayDeque;
import java.util.Collections;
import java.util.Queue;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.el.ELException;
import javax.faces.FacesException;
@@ -31,9 +33,6 @@
import javax.faces.event.ExceptionQueuedEventContext;
import javax.faces.event.SystemEvent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* @author Simon Lessard (latest modification by $Author: slessard $)
* @version $Revision: 696523 $ $Date: 2009-03-14 20:06:50 -0400 (mer., 17 sept. 2008) $
@@ -42,7 +41,8 @@
*/
public class PreJsf2ExceptionHandlerFactory extends ExceptionHandlerFactory
{
- private static final Log log = LogFactory.getLog (PreJsf2ExceptionHandlerFactory.class);
+ //private static final Log log = LogFactory.getLog (PreJsf2ExceptionHandlerFactory.class);
+ private static final Logger log = Logger.getLogger(PreJsf2ExceptionHandlerFactory.class.getName());
private static PreJsf2ExceptionHandlerImpl exceptionHandler =
new PreJsf2ExceptionHandlerFactory.PreJsf2ExceptionHandlerImpl();
@@ -169,7 +169,7 @@
// According to the spec, just need to log and swallow the exceptions.
// TODO: better message?
- log.error ("Exception encountered", exception);
+ log.log(Level.SEVERE, "Exception encountered", exception);
}
} while (!unhandled.isEmpty());
}
Modified: myfaces/core/trunk/api/src/main/java/javax/faces/webapp/_ErrorPageWriter.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/webapp/_ErrorPageWriter.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/webapp/_ErrorPageWriter.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/webapp/_ErrorPageWriter.java Tue Oct 13 17:42:36 2009
@@ -18,29 +18,43 @@
*/
package javax.faces.webapp;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.faces.FacesException;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ExternalContext;
-import javax.faces.component.UIComponent;
-import javax.el.Expression;
-import javax.el.ValueExpression;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletResponse;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
-import java.io.*;
+import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.text.DateFormat;
-import java.util.*;
-import java.util.regex.Pattern;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.el.Expression;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletResponse;
/**
* @author Jacob Hookom (ICLA with ASF filed)
@@ -48,7 +62,8 @@
final class _ErrorPageWriter
{
- private static final Log log = LogFactory.getLog(_ErrorPageWriter.class);
+ //private static final Log log = LogFactory.getLog(_ErrorPageWriter.class);
+ private static final Logger log = Logger.getLogger(_ErrorPageWriter.class.getName());
private final static String TS = "<";
@@ -567,7 +582,7 @@
debugHtml(writer, facesContext, ex);
- log.error("An exception occurred", ex);
+ log.log(Level.SEVERE, "An exception occurred", ex);
}
else
{
@@ -602,7 +617,7 @@
for (Exception exception : exceptionList)
{
- log.error("An exception occurred", exception);
+ log.log(Level.SEVERE, "An exception occurred", exception);
}
}
else
Modified: myfaces/core/trunk/impl/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/pom.xml?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/pom.xml (original)
+++ myfaces/core/trunk/impl/pom.xml Tue Oct 13 17:42:36 2009
@@ -646,11 +646,11 @@
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
- <dependency>
+ <!-- dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
- </dependency>
+ </dependency -->
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationFactoryImpl.java Tue Oct 13 17:42:36 2009
@@ -18,14 +18,14 @@
*/
package org.apache.myfaces.application;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
import javax.faces.application.Application;
import javax.faces.application.ApplicationFactory;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* @author Manfred Geiler (latest modification by $Author$)
* @author Thomas Spiegl
@@ -33,7 +33,8 @@
*/
public class ApplicationFactoryImpl extends ApplicationFactory
{
- private static final Log log = LogFactory.getLog(ApplicationFactoryImpl.class);
+ //private static final Log log = LogFactory.getLog(ApplicationFactoryImpl.class);
+ private static final Logger log = Logger.getLogger(ApplicationFactoryImpl.class.getName());
/**
* Application is thread-safe (see Application javadoc)
@@ -53,7 +54,7 @@
{
_application = new ApplicationImpl();
putApplicationOnMap();
- if (log.isTraceEnabled()) log.trace("New ApplicationFactory instance created");
+ if (log.isLoggable(Level.FINEST)) log.finest("New ApplicationFactory instance created");
}
public void purgeApplication()
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ApplicationImpl.java Tue Oct 13 17:42:36 2009
@@ -32,6 +32,8 @@
import java.util.TimeZone;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.el.CompositeELResolver;
import javax.el.ELContext;
@@ -80,8 +82,6 @@
import javax.naming.NamingException;
import org.apache.commons.beanutils.BeanUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.application.jsp.JspStateManagerImpl;
import org.apache.myfaces.config.RuntimeConfig;
import org.apache.myfaces.config.impl.digester.elements.Property;
@@ -109,7 +109,8 @@
@SuppressWarnings("deprecation")
public class ApplicationImpl extends Application
{
- private static final Log log = LogFactory.getLog(ApplicationImpl.class);
+ //private static final Log log = LogFactory.getLog(ApplicationImpl.class);
+ private static final Logger log = Logger.getLogger(ApplicationImpl.class.getName());
private final static VariableResolver VARIABLERESOLVER = new VariableResolverToApplicationELResolverAdapter();
@@ -224,8 +225,8 @@
_resourceHandler = new ResourceHandlerImpl();
_runtimeConfig = runtimeConfig;
- if (log.isTraceEnabled())
- log.trace("New Application instance created");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("New Application instance created");
}
public static void setInitializingRuntimeConfig(RuntimeConfig config)
@@ -492,7 +493,7 @@
// If the act of invoking the processListener method causes an AbortProcessingException to be thrown,
// processing of the listeners must be aborted, no further processing of the listeners for this event must
// take place, and the exception must be logged with Level.SEVERE.
- log.error("Event processing was aborted", e);
+ log.log(Level.SEVERE, "Event processing was aborted", e);
}
}
@@ -526,8 +527,8 @@
checkNull(actionListener, "actionListener");
_actionListener = actionListener;
- if (log.isTraceEnabled())
- log.trace("set actionListener = " + actionListener.getClass().getName());
+ if (log.isLoggable(Level.FINEST))
+ log.finest("set actionListener = " + actionListener.getClass().getName());
}
@Override
@@ -566,8 +567,8 @@
checkNull(locale, "locale");
_defaultLocale = locale;
- if (log.isTraceEnabled())
- log.trace("set defaultLocale = " + locale.getCountry() + " " + locale.getLanguage());
+ if (log.isLoggable(Level.FINEST))
+ log.finest("set defaultLocale = " + locale.getCountry() + " " + locale.getLanguage());
}
@Override
@@ -582,8 +583,8 @@
checkNull(messageBundle, "messageBundle");
_messageBundle = messageBundle;
- if (log.isTraceEnabled())
- log.trace("set MessageBundle = " + messageBundle);
+ if (log.isLoggable(Level.FINEST))
+ log.finest("set MessageBundle = " + messageBundle);
}
@Override
@@ -598,8 +599,8 @@
checkNull(navigationHandler, "navigationHandler");
_navigationHandler = navigationHandler;
- if (log.isTraceEnabled())
- log.trace("set NavigationHandler = " + navigationHandler.getClass().getName());
+ if (log.isLoggable(Level.FINEST))
+ log.finest("set NavigationHandler = " + navigationHandler.getClass().getName());
}
@Override
@@ -624,8 +625,8 @@
_runtimeConfig.setPropertyResolver(propertyResolver);
- if (log.isTraceEnabled())
- log.trace("set PropertyResolver = " + propertyResolver.getClass().getName());
+ if (log.isLoggable(Level.FINEST))
+ log.finest("set PropertyResolver = " + propertyResolver.getClass().getName());
}
@Override
@@ -652,7 +653,7 @@
}
else
{
- log.error("JNDI lookup for key " + ProjectStage.PROJECT_STAGE_JNDI_NAME
+ log.severe("JNDI lookup for key " + ProjectStage.PROJECT_STAGE_JNDI_NAME
+ " should return a java.lang.String value");
}
}
@@ -694,12 +695,12 @@
}
catch (IllegalArgumentException e)
{
- log.error("Couldn't discover the current project stage", e);
+ log.log(Level.SEVERE, "Couldn't discover the current project stage", e);
}
}
else
{
- if (log.isInfoEnabled())
+ if (log.isLoggable(Level.INFO))
{
log.info("Couldn't discover the current project stage, using " + ProjectStage.Production);
}
@@ -746,8 +747,8 @@
checkNull(locales, "locales");
_supportedLocales = locales;
- if (log.isTraceEnabled())
- log.trace("set SupportedLocales");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("set SupportedLocales");
}
@Override
@@ -778,8 +779,8 @@
_runtimeConfig.setVariableResolver(variableResolver);
- if (log.isTraceEnabled())
- log.trace("set VariableResolver = " + variableResolver.getClass().getName());
+ if (log.isLoggable(Level.FINEST))
+ log.finest("set VariableResolver = " + variableResolver.getClass().getName());
}
/**
@@ -798,8 +799,8 @@
checkNull(viewHandler, "viewHandler");
_viewHandler = viewHandler;
- if (log.isTraceEnabled())
- log.trace("set ViewHandler = " + viewHandler.getClass().getName());
+ if (log.isLoggable(Level.FINEST))
+ log.finest("set ViewHandler = " + viewHandler.getClass().getName());
}
@Override
@@ -855,12 +856,12 @@
try
{
_behaviorClassMap.put(behaviorId, ClassUtils.simpleClassForName(behaviorClass));
- if (log.isTraceEnabled())
- log.trace("add Behavior class = " + behaviorClass + " for id = " + behaviorId);
+ if (log.isLoggable(Level.FINEST))
+ log.finest("add Behavior class = " + behaviorClass + " for id = " + behaviorId);
}
catch (Exception e)
{
- log.error("Behavior class " + behaviorClass + " not found", e);
+ log.log(Level.SEVERE, "Behavior class " + behaviorClass + " not found", e);
}
}
@@ -877,12 +878,12 @@
try
{
_componentClassMap.put(componentType, ClassUtils.simpleClassForName(componentClassName));
- if (log.isTraceEnabled())
- log.trace("add Component class = " + componentClassName + " for type = " + componentType);
+ if (log.isLoggable(Level.FINEST))
+ log.finest("add Component class = " + componentClassName + " for type = " + componentType);
}
catch (Exception e)
{
- log.error("Component class " + componentClassName + " not found", e);
+ log.log(Level.SEVERE, "Component class " + componentClassName + " not found", e);
}
}
@@ -898,12 +899,12 @@
try
{
_converterIdToClassMap.put(converterId, ClassUtils.simpleClassForName(converterClass));
- if (log.isTraceEnabled())
- log.trace("add Converter id = " + converterId + " converterClass = " + converterClass);
+ if (log.isLoggable(Level.FINEST))
+ log.finest("add Converter id = " + converterId + " converterClass = " + converterClass);
}
catch (Exception e)
{
- log.error("Converter class " + converterClass + " not found", e);
+ log.log(Level.SEVERE, "Converter class " + converterClass + " not found", e);
}
}
@@ -917,12 +918,12 @@
try
{
_converterClassNameToClassMap.put(targetClass, converterClass);
- if (log.isTraceEnabled())
- log.trace("add Converter for class = " + targetClass + " converterClass = " + converterClass);
+ if (log.isLoggable(Level.FINEST))
+ log.finest("add Converter for class = " + targetClass + " converterClass = " + converterClass);
}
catch (Exception e)
{
- log.error("Converter class " + converterClass + " not found", e);
+ log.log(Level.SEVERE, "Converter class " + converterClass + " not found", e);
}
}
@@ -949,12 +950,12 @@
try
{
_validatorClassMap.put(validatorId, ClassUtils.simpleClassForName(validatorClass));
- if (log.isTraceEnabled())
- log.trace("add Validator id = " + validatorId + " class = " + validatorClass);
+ if (log.isLoggable(Level.FINEST))
+ log.finest("add Validator id = " + validatorId + " class = " + validatorClass);
}
catch (Exception e)
{
- log.error("Validator class " + validatorClass + " not found", e);
+ log.log(Level.SEVERE, "Validator class " + validatorClass + " not found", e);
}
}
@@ -977,7 +978,7 @@
}
catch (Exception e)
{
- log.error("Could not instantiate behavior " + behaviorClass, e);
+ log.log(Level.SEVERE, "Could not instantiate behavior " + behaviorClass, e);
throw new FacesException("Could not instantiate behavior: " + behaviorClass, e);
}
}
@@ -1068,17 +1069,17 @@
}
catch (InstantiationException e)
{
- log.error("Could not instantiate component class name = " + fqcn, e);
+ log.log(Level.SEVERE, "Could not instantiate component class name = " + fqcn, e);
throw new FacesException("Could not instantiate component class name = " + fqcn, e);
}
catch (IllegalAccessException e)
{
- log.error("Could not instantiate component class name = " + fqcn, e);
+ log.log(Level.SEVERE, "Could not instantiate component class name = " + fqcn, e);
throw new FacesException("Could not instantiate component class name = " + fqcn, e);
}
catch (Exception e)
{
- log.error("Could not instantiate component class name = " + fqcn, e);
+ log.log(Level.SEVERE, "Could not instantiate component class name = " + fqcn, e);
}
}
@@ -1144,7 +1145,7 @@
final Class<? extends UIComponent> componentClass = _componentClassMap.get(componentType);
if (componentClass == null)
{
- log.error("Undefined component type " + componentType);
+ log.log(Level.SEVERE, "Undefined component type " + componentType);
throw new FacesException("Undefined component type " + componentType);
}
@@ -1156,7 +1157,7 @@
}
catch (Exception e)
{
- log.error("Could not instantiate component componentType = " + componentType, e);
+ log.log(Level.SEVERE, "Could not instantiate component componentType = " + componentType, e);
throw new FacesException("Could not instantiate component componentType = " + componentType, e);
}
}
@@ -1226,7 +1227,7 @@
}
catch (Exception e)
{
- log.error("Could not instantiate converter " + converterClass, e);
+ log.log(Level.SEVERE, "Could not instantiate converter " + converterClass, e);
throw new FacesException("Could not instantiate converter: " + converterClass, e);
}
}
@@ -1299,7 +1300,7 @@
}
catch (Exception e)
{
- log.error("Could not instantiate converter " + converterClassName, e);
+ log.log(Level.SEVERE, "Could not instantiate converter " + converterClassName, e);
throw new FacesException("Could not instantiate converter: " + converterClassName, e);
}
}
@@ -1373,7 +1374,7 @@
}
catch (Throwable th)
{
- log.error("Initializing converter : " + converterClass.getName() + " with property : "
+ log.log(Level.SEVERE, "Initializing converter : " + converterClass.getName() + " with property : "
+ property.getPropertyName() + " and value : " + property.getDefaultValue() + " failed.");
}
}
@@ -1427,7 +1428,7 @@
if (validatorClass == null)
{
String message = "Unknown validator id '" + validatorId + "'.";
- log.error(message);
+ log.severe(message);
throw new FacesException(message);
}
@@ -1437,7 +1438,7 @@
}
catch (Exception e)
{
- log.error("Could not instantiate validator " + validatorClass, e);
+ log.log(Level.SEVERE, "Could not instantiate validator " + validatorClass, e);
throw new FacesException("Could not instantiate validator: " + validatorClass, e);
}
}
@@ -1705,7 +1706,7 @@
if (renderer == null)
{
// If no such Renderer can be found, a message must be logged with a helpful error message.
- log.error("renderer cannot be found for component type " + componentType + " and renderer type "
+ log.severe("renderer cannot be found for component type " + componentType + " and renderer type "
+ rendererType);
}
else
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/DefaultViewHandlerSupport.java Tue Oct 13 17:42:36 2009
@@ -18,16 +18,15 @@
*/
package org.apache.myfaces.application;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.net.MalformedURLException;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.faces.application.ViewHandler;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import java.net.MalformedURLException;
-import java.util.Map;
-
/**
* A ViewHandlerSupport implementation for use with standard Java Servlet engines,
* ie an engine that supports javax.servlet, and uses a standard web.xml file.
@@ -43,7 +42,8 @@
private static final String CACHED_SERVLET_MAPPING =
DefaultViewHandlerSupport.class.getName() + ".CACHED_SERVLET_MAPPING";
- private static final Log log = LogFactory.getLog(DefaultViewHandlerSupport.class);
+ //private static final Log log = LogFactory.getLog(DefaultViewHandlerSupport.class);
+ private static final Logger log = Logger.getLogger(DefaultViewHandlerSupport.class.getName());
public String calculateViewId(FacesContext context, String viewId)
{
@@ -120,9 +120,9 @@
builder.append(viewId);
}
String calculatedActionURL = builder.toString();
- if (log.isTraceEnabled())
+ if (log.isLoggable(Level.FINEST))
{
- log.trace("Calculated actionURL: '" + calculatedActionURL + "' for viewId: '" + viewId + "'");
+ log.finest("Calculated actionURL: '" + calculatedActionURL + "' for viewId: '" + viewId + "'");
}
return calculatedActionURL;
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java Tue Oct 13 17:42:36 2009
@@ -28,22 +28,19 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
-import javax.el.ExpressionFactory;
-import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.ConfigurableNavigationHandler;
-import javax.faces.application.NavigationHandler;
+import javax.faces.application.NavigationCase;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.PartialViewContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.config.RuntimeConfig;
-import javax.faces.application.NavigationCase;
import org.apache.myfaces.config.element.NavigationRule;
import org.apache.myfaces.shared_impl.util.HashMapUtils;
@@ -55,7 +52,8 @@
public class NavigationHandlerImpl
extends ConfigurableNavigationHandler
{
- private static final Log log = LogFactory.getLog(NavigationHandlerImpl.class);
+ //private static final Log log = LogFactory.getLog(NavigationHandlerImpl.class);
+ private static final Logger log = Logger.getLogger(NavigationHandlerImpl.class.getName());
private static final String ASTERISK = "*";
@@ -64,7 +62,7 @@
public NavigationHandlerImpl()
{
- if (log.isTraceEnabled()) log.trace("New NavigationHandler instance created");
+ if (log.isLoggable(Level.FINEST)) log.finest("New NavigationHandler instance created");
}
@Override
@@ -74,9 +72,9 @@
if (navigationCase != null)
{
- if (log.isTraceEnabled())
+ if (log.isLoggable(Level.FINEST))
{
- log.trace("handleNavigation fromAction=" + fromAction + " outcome=" + outcome +
+ log.finest("handleNavigation fromAction=" + fromAction + " outcome=" + outcome +
" toViewId =" + navigationCase.getToViewId(facesContext) +
" redirect=" + navigationCase.isRedirect());
}
@@ -141,9 +139,9 @@
else
{
// no navigationcase found, stay on current ViewRoot
- if (log.isTraceEnabled())
+ if (log.isLoggable(Level.FINEST))
{
- log.trace("handleNavigation fromAction=" + fromAction + " outcome=" + outcome +
+ log.finest("handleNavigation fromAction=" + fromAction + " outcome=" + outcome +
" no matching navigation-case found, staying on current ViewRoot");
}
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java Tue Oct 13 17:42:36 2009
@@ -25,6 +25,8 @@
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
@@ -33,8 +35,6 @@
import javax.servlet.ServletResponseWrapper;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.resource.ResourceImpl;
import org.apache.myfaces.resource.ResourceLoader;
import org.apache.myfaces.resource.ResourceMeta;
@@ -54,7 +54,8 @@
private ResourceHandlerSupport _resourceHandlerSupport;
- private static final Log log = LogFactory.getLog(ResourceHandlerImpl.class);
+ //private static final Log log = LogFactory.getLog(ResourceHandlerImpl.class);
+ private static final Logger log = Logger.getLogger(ResourceHandlerImpl.class.getName());
private static final int _BUFFER_SIZE = 2048;
@@ -310,8 +311,8 @@
catch (IOException e)
{
//TODO: Log using a localized message (which one?)
- if (log.isErrorEnabled())
- log.error("Error trying to load resource " + resourceName
+ if (log.isLoggable(Level.SEVERE))
+ log.severe("Error trying to load resource " + resourceName
+ " with library " + libraryName + " :"
+ e.getMessage());
httpServletResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java Tue Oct 13 17:42:36 2009
@@ -25,6 +25,8 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
@@ -42,15 +44,14 @@
import javax.faces.view.ViewMetadata;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.myfaces.shared_impl.config.MyfacesConfig;
import org.apache.myfaces.shared_impl.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.view.facelets.StateWriter;
public class ViewHandlerImpl extends ViewHandler
{
- private static final Log log = LogFactory.getLog(ViewHandlerImpl.class);
+ //private static final Log log = LogFactory.getLog(ViewHandlerImpl.class);
+ private static final Logger log = Logger.getLogger(ViewHandlerImpl.class.getName());
public static final String FORM_STATE_MARKER = "<!-...@-->";
private ViewHandlerSupport _viewHandlerSupport;
private ViewDeclarationLanguageFactory _vdlFactory;
@@ -58,8 +59,8 @@
public ViewHandlerImpl()
{
_vdlFactory = (ViewDeclarationLanguageFactory)FactoryFinder.getFactory(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY);
- if (log.isTraceEnabled())
- log.trace("New ViewHandler instance created");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("New ViewHandler instance created");
}
@Override
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspStateManagerImpl.java Tue Oct 13 17:42:36 2009
@@ -18,17 +18,31 @@
*/
package org.apache.myfaces.application.jsp;
-import org.apache.commons.collections.map.AbstractReferenceMap;
-import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.application.MyfacesStateManager;
-import org.apache.myfaces.application.TreeStructureManager;
-import org.apache.myfaces.renderkit.MyfacesResponseStateManager;
-import org.apache.myfaces.shared_impl.renderkit.RendererUtils;
-import org.apache.myfaces.shared_impl.util.MyFacesObjectInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
-import javax.faces.FacesException;
import javax.faces.FactoryFinder;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
@@ -41,14 +55,13 @@
import javax.faces.view.StateManagementStrategy;
import javax.faces.view.ViewDeclarationLanguage;
-import java.io.*;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.*;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.GZIPOutputStream;
+import org.apache.commons.collections.map.AbstractReferenceMap;
+import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.myfaces.application.MyfacesStateManager;
+import org.apache.myfaces.application.TreeStructureManager;
+import org.apache.myfaces.renderkit.MyfacesResponseStateManager;
+import org.apache.myfaces.shared_impl.renderkit.RendererUtils;
+import org.apache.myfaces.shared_impl.util.MyFacesObjectInputStream;
/**
* Default StateManager implementation for use when views are defined
@@ -60,7 +73,8 @@
*/
public class JspStateManagerImpl extends MyfacesStateManager
{
- private static final Log log = LogFactory.getLog(JspStateManagerImpl.class);
+ //private static final Log log = LogFactory.getLog(JspStateManagerImpl.class);
+ private static final Logger log = Logger.getLogger(JspStateManagerImpl.class.getName());
private static final String SERIALIZED_VIEW_SESSION_ATTR=
JspStateManagerImpl.class.getName() + ".SERIALIZED_VIEW";
@@ -155,13 +169,13 @@
public JspStateManagerImpl()
{
- if (log.isTraceEnabled()) log.trace("New JspStateManagerImpl instance created");
+ if (log.isLoggable(Level.FINEST)) log.finest("New JspStateManagerImpl instance created");
}
@Override
protected Object getComponentStateToSave(FacesContext facesContext)
{
- if (log.isTraceEnabled()) log.trace("Entering getComponentStateToSave");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering getComponentStateToSave");
UIViewRoot viewRoot = facesContext.getViewRoot();
if (viewRoot.isTransient())
@@ -171,7 +185,7 @@
Object serializedComponentStates = viewRoot.processSaveState(facesContext);
//Locale is a state attribute of UIViewRoot and need not be saved explicitly
- if (log.isTraceEnabled()) log.trace("Exiting getComponentStateToSave");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting getComponentStateToSave");
return serializedComponentStates;
}
@@ -184,7 +198,7 @@
@Override
protected Object getTreeStructureToSave(FacesContext facesContext)
{
- if (log.isTraceEnabled()) log.trace("Entering getTreeStructureToSave");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering getTreeStructureToSave");
UIViewRoot viewRoot = facesContext.getViewRoot();
if (viewRoot.isTransient())
{
@@ -192,7 +206,7 @@
}
TreeStructureManager tsm = new TreeStructureManager();
Object retVal = tsm.buildTreeStructureToSave(viewRoot);
- if (log.isTraceEnabled()) log.trace("Exiting getTreeStructureToSave");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting getTreeStructureToSave");
return retVal;
}
@@ -207,7 +221,7 @@
UIViewRoot uiViewRoot,
String renderKitId)
{
- if (log.isTraceEnabled()) log.trace("Entering restoreComponentState");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering restoreComponentState");
//===========================================
// first, locate the saved state information
@@ -229,7 +243,7 @@
}
if (serializedComponentStates == null)
{
- log.error("No serialized component state found in client request!");
+ log.severe("No serialized component state found in client request!");
// mark UIViewRoot invalid by resetting view id
uiViewRoot.setViewId(null);
return;
@@ -242,7 +256,7 @@
Object[] stateObj = (Object[]) getSerializedViewFromServletSession(facesContext, uiViewRoot.getViewId(), serverStateId);
if (stateObj == null)
{
- log.error("No serialized view found in server session!");
+ log.severe("No serialized view found in server session!");
// mark UIViewRoot invalid by resetting view id
uiViewRoot.setViewId(null);
return;
@@ -251,7 +265,7 @@
serializedComponentStates = serializedView.getState();
if (serializedComponentStates == null)
{
- log.error("No serialized component state found in server session!");
+ log.severe("No serialized component state found in server session!");
return;
}
}
@@ -265,7 +279,7 @@
// now ask the view root component to restore its state
uiViewRoot.processRestoreState(facesContext, serializedComponentStates);
- if (log.isTraceEnabled()) log.trace("Exiting restoreComponentState");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting restoreComponentState");
}
protected Integer getServerStateId(Object[] state)
@@ -289,7 +303,7 @@
String viewId,
String renderKitId)
{
- if (log.isTraceEnabled()) log.trace("Entering restoreTreeStructure");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering restoreTreeStructure");
RenderKit rk = getRenderKitFactory().getRenderKit(facesContext, renderKitId);
ResponseStateManager responseStateManager = rk.getResponseStateManager();
@@ -301,13 +315,13 @@
Object treeStructure = responseStateManager.getTreeStructureToRestore(facesContext, viewId);
if (treeStructure == null)
{
- if (log.isDebugEnabled()) log.debug("Exiting restoreTreeStructure - No tree structure state found in client request");
+ if (log.isLoggable(Level.FINE)) log.fine("Exiting restoreTreeStructure - No tree structure state found in client request");
return null;
}
TreeStructureManager tsm = new TreeStructureManager();
uiViewRoot = tsm.restoreTreeStructure(treeStructure);
- if (log.isTraceEnabled()) log.trace("Tree structure restored from client request");
+ if (log.isLoggable(Level.FINEST)) log.finest("Tree structure restored from client request");
}
else
{
@@ -317,7 +331,7 @@
Object[] stateObj = (Object[]) getSerializedViewFromServletSession(facesContext, viewId, serverStateId);
if (stateObj == null)
{
- if (log.isDebugEnabled()) log.debug("Exiting restoreTreeStructure - No serialized view found in server session!");
+ if (log.isLoggable(Level.FINE)) log.fine("Exiting restoreTreeStructure - No serialized view found in server session!");
return null;
}
@@ -325,23 +339,23 @@
Object treeStructure = serializedView.getStructure();
if (treeStructure == null)
{
- if (log.isDebugEnabled()) log.debug("Exiting restoreTreeStructure - No tree structure state found in server session, former UIViewRoot must have been transient");
+ if (log.isLoggable(Level.FINE)) log.fine("Exiting restoreTreeStructure - No tree structure state found in server session, former UIViewRoot must have been transient");
return null;
}
TreeStructureManager tsm = new TreeStructureManager();
uiViewRoot = tsm.restoreTreeStructure(serializedView.getStructure());
- if (log.isTraceEnabled()) log.trace("Tree structure restored from server session");
+ if (log.isLoggable(Level.FINEST)) log.finest("Tree structure restored from server session");
}
- if (log.isTraceEnabled()) log.trace("Exiting restoreTreeStructure");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting restoreTreeStructure");
return uiViewRoot;
}
@Override
public UIViewRoot restoreView(FacesContext facesContext, String viewId, String renderKitId)
{
- if (log.isTraceEnabled()) log.trace("Entering restoreView - viewId: "+viewId+" ; renderKitId: "+renderKitId);
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering restoreView - viewId: "+viewId+" ; renderKitId: "+renderKitId);
UIViewRoot uiViewRoot = null;
@@ -355,7 +369,7 @@
if (sms != null)
{
- if (log.isTraceEnabled()) log.trace("Redirect to StateManagementStrategy: "+sms.getClass().getName());
+ if (log.isLoggable(Level.FINEST)) log.finest("Redirect to StateManagementStrategy: "+sms.getClass().getName());
uiViewRoot = sms.restoreView(facesContext, viewId, renderKitId);
}
@@ -367,13 +381,13 @@
Object state;
if (isSavingStateInClient(facesContext))
{
- if (log.isTraceEnabled()) log.trace("Restoring view from client");
+ if (log.isLoggable(Level.FINEST)) log.finest("Restoring view from client");
state = responseStateManager.getState(facesContext, viewId);
}
else
{
- if (log.isTraceEnabled()) log.trace("Restoring view from session");
+ if (log.isLoggable(Level.FINEST)) log.finest("Restoring view from session");
Integer serverStateId = getServerStateId((Object[]) responseStateManager.getState(facesContext, viewId));
@@ -391,7 +405,7 @@
}
}
}
- if (log.isTraceEnabled()) log.trace("Exiting restoreView - "+viewId);
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting restoreView - "+viewId);
return uiViewRoot;
}
@@ -414,7 +428,7 @@
if (sms != null)
{
- if (log.isTraceEnabled()) log.trace("Calling saveView of StateManagementStrategy: "+sms.getClass().getName());
+ if (log.isLoggable(Level.FINEST)) log.finest("Calling saveView of StateManagementStrategy: "+sms.getClass().getName());
return sms.saveView(facesContext);
}
@@ -435,11 +449,11 @@
@Override
public SerializedView saveSerializedView(FacesContext facesContext) throws IllegalStateException
{
- if (log.isTraceEnabled()) log.trace("Entering saveSerializedView");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering saveSerializedView");
checkForDuplicateIds(facesContext, facesContext.getViewRoot(), new HashSet<String>());
- if (log.isTraceEnabled()) log.trace("Processing saveSerializedView - Checked for duplicate Ids");
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing saveSerializedView - Checked for duplicate Ids");
ExternalContext externalContext = facesContext.getExternalContext();
@@ -448,7 +462,7 @@
.get(SERIALIZED_VIEW_REQUEST_ATTR);
if (serializedView == null)
{
- if (log.isTraceEnabled()) log.trace("Processing saveSerializedView - create new serialized view");
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing saveSerializedView - create new serialized view");
// first call to saveSerializedView --> create SerializedView
Object treeStruct = getTreeStructureToSave(facesContext);
@@ -457,22 +471,22 @@
externalContext.getRequestMap().put(SERIALIZED_VIEW_REQUEST_ATTR,
serializedView);
- if (log.isTraceEnabled()) log.trace("Processing saveSerializedView - new serialized view created");
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing saveSerializedView - new serialized view created");
}
Object[] serializedViewArray = (Object[]) serializedView;
if (!isSavingStateInClient(facesContext))
{
- if (log.isTraceEnabled()) log.trace("Processing saveSerializedView - server-side state saving - save state");
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing saveSerializedView - server-side state saving - save state");
//save state in server session
saveSerializedViewInServletSession(facesContext, serializedView);
- if (log.isTraceEnabled()) log.trace("Exiting saveSerializedView - server-side state saving - saved state");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting saveSerializedView - server-side state saving - saved state");
return new SerializedView(serializedViewArray[0], new Object[0]);
}
- if (log.isTraceEnabled()) log.trace("Exiting saveSerializedView - client-side state saving");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting saveSerializedView - client-side state saving");
return new SerializedView(serializedViewArray[0], serializedViewArray[1]);
}
@@ -552,7 +566,7 @@
public void writeState(FacesContext facesContext,
SerializedView serializedView) throws IOException
{
- if (log.isTraceEnabled()) log.trace("Entering writeState");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering writeState");
UIViewRoot uiViewRoot = facesContext.getViewRoot();
//save state in response (client)
@@ -577,7 +591,7 @@
responseStateManager.writeState(facesContext, state);
}
- if (log.isTraceEnabled()) log.trace("Exiting writeState");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting writeState");
}
@@ -591,11 +605,11 @@
public void writeStateAsUrlParams(FacesContext facesContext,
SerializedView serializedView) throws IOException
{
- if (log.isTraceEnabled()) log.trace("Entering writeStateAsUrlParams");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering writeStateAsUrlParams");
if (isSavingStateInClient(facesContext))
{
- if (log.isTraceEnabled()) log.trace("Processing writeStateAsUrlParams - client-side state saving writing state");
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing writeStateAsUrlParams - client-side state saving writing state");
UIViewRoot uiViewRoot = facesContext.getViewRoot();
//save state in response (client)
@@ -608,11 +622,11 @@
}
else
{
- log.error("ResponseStateManager of render kit " + uiViewRoot.getRenderKitId() + " is no MyfacesResponseStateManager and does not support saving state in url parameters.");
+ log.severe("ResponseStateManager of render kit " + uiViewRoot.getRenderKitId() + " is no MyfacesResponseStateManager and does not support saving state in url parameters.");
}
}
- if (log.isTraceEnabled()) log.trace("Exiting writeStateAsUrlParams");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting writeStateAsUrlParams");
}
//helpers
@@ -724,11 +738,11 @@
protected Object serializeView(FacesContext context, Object serializedView)
{
- if (log.isTraceEnabled()) log.trace("Entering serializeView");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering serializeView");
if(isSerializeStateInSession(context))
{
- if (log.isTraceEnabled()) log.trace("Processing serializeView - serialize state in session");
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing serializeView - serialize state in session");
ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
try
@@ -736,14 +750,14 @@
OutputStream os = baos;
if(isCompressStateInSession(context))
{
- if (log.isTraceEnabled()) log.trace("Processing serializeView - serialize compressed");
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing serializeView - serialize compressed");
os.write(COMPRESSED_FLAG);
os = new GZIPOutputStream(os, 1024);
}
else
{
- if (log.isTraceEnabled()) log.trace("Processing serializeView - serialize uncompressed");
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing serializeView - serialize uncompressed");
os.write(UNCOMPRESSED_FLAG);
}
@@ -756,19 +770,19 @@
out.close();
baos.close();
- if (log.isTraceEnabled()) log.trace("Exiting serializeView - serialized. Bytes : "+baos.size());
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting serializeView - serialized. Bytes : "+baos.size());
return baos.toByteArray();
}
catch (IOException e)
{
- log.error("Exiting serializeView - Could not serialize state: " + e.getMessage(), e);
+ log.log(Level.SEVERE, "Exiting serializeView - Could not serialize state: " + e.getMessage(), e);
return null;
}
}
- if (log.isTraceEnabled())
- log.trace("Exiting serializeView - do not serialize state in session.");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("Exiting serializeView - do not serialize state in session.");
return serializedView;
@@ -812,11 +826,11 @@
protected Object deserializeView(Object state)
{
- if (log.isTraceEnabled()) log.trace("Entering deserializeView");
+ if (log.isLoggable(Level.FINEST)) log.finest("Entering deserializeView");
if(state instanceof byte[])
{
- if (log.isTraceEnabled()) log.trace("Processing deserializeView - deserializing serialized state. Bytes : "+((byte[]) state).length);
+ if (log.isLoggable(Level.FINEST)) log.finest("Processing deserializeView - deserializing serialized state. Bytes : "+((byte[]) state).length);
try
{
@@ -859,34 +873,34 @@
}
catch (PrivilegedActionException e)
{
- log.error("Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
+ log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
catch (IOException e)
{
- log.error("Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
+ log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
catch (ClassNotFoundException e)
{
- log.error("Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
+ log.log(Level.SEVERE, "Exiting deserializeView - Could not deserialize state: " + e.getMessage(), e);
return null;
}
}
else if (state instanceof Object[])
{
- if (log.isTraceEnabled()) log.trace("Exiting deserializeView - state not serialized.");
+ if (log.isLoggable(Level.FINEST)) log.finest("Exiting deserializeView - state not serialized.");
return state;
}
else if(state == null)
{
- log.error("Exiting deserializeView - this method should not be called with a null-state.");
+ log.severe("Exiting deserializeView - this method should not be called with a null-state.");
return null;
}
else
{
- log.error("Exiting deserializeView - this method should not be called with a state of type : "+state.getClass());
+ log.severe("Exiting deserializeView - this method should not be called with a state of type : "+state.getClass());
return null;
}
}
@@ -956,7 +970,7 @@
views = Integer.parseInt(value);
if (views <= 0)
{
- log.error("Configured value for " + NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ log.severe("Configured value for " + NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ " is not valid, must be an value > 0, using default value ("
+ DEFAULT_NUMBER_OF_VIEWS_IN_SESSION);
views = DEFAULT_NUMBER_OF_VIEWS_IN_SESSION;
@@ -964,7 +978,7 @@
}
catch (Throwable e)
{
- log.error("Error determining the value for " + NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ log.log(Level.SEVERE, "Error determining the value for " + NUMBER_OF_VIEWS_IN_SESSION_PARAM
+ ", expected an integer value > 0, using default value ("
+ DEFAULT_NUMBER_OF_VIEWS_IN_SESSION + "): " + e.getMessage(), e);
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java?rev=824859&r1=824858&r2=824859&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/jsp/JspViewHandlerImpl.java Tue Oct 13 17:42:36 2009
@@ -18,13 +18,13 @@
*/
package org.apache.myfaces.application.jsp;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.myfaces.application.DefaultViewHandlerSupport;
-import org.apache.myfaces.application.InvalidViewIdException;
-import org.apache.myfaces.application.ViewHandlerSupport;
-import org.apache.myfaces.shared_impl.config.MyfacesConfig;
-import org.apache.myfaces.shared_impl.renderkit.html.util.JavascriptUtils;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
@@ -44,11 +44,12 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.jstl.core.Config;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.Locale;
+
+import org.apache.myfaces.application.DefaultViewHandlerSupport;
+import org.apache.myfaces.application.InvalidViewIdException;
+import org.apache.myfaces.application.ViewHandlerSupport;
+import org.apache.myfaces.shared_impl.config.MyfacesConfig;
+import org.apache.myfaces.shared_impl.renderkit.html.util.JavascriptUtils;
/**
* Implementation of the ViewHandler interface that knows how to use JSP pages
@@ -110,7 +111,8 @@
*/
public class JspViewHandlerImpl extends ViewHandler
{
- private static final Log log = LogFactory.getLog(JspViewHandlerImpl.class);
+ //private static final Log log = LogFactory.getLog(JspViewHandlerImpl.class);
+ private static final Logger log = Logger.getLogger(JspViewHandlerImpl.class.getName());
public static final String FORM_STATE_MARKER = "<!-...@-->";
public static final int FORM_STATE_MARKER_LEN = FORM_STATE_MARKER.length();
@@ -120,8 +122,8 @@
public JspViewHandlerImpl()
{
- if (log.isTraceEnabled())
- log.trace("New ViewHandler instance created");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("New ViewHandler instance created");
}
/**
@@ -253,8 +255,8 @@
uiViewRoot.setRenderKitId(applicationViewHandler.calculateRenderKitId(facesContext));
}
- if (log.isTraceEnabled())
- log.trace("Created view " + viewId);
+ if (log.isLoggable(Level.FINEST))
+ log.finest("Created view " + viewId);
return uiViewRoot;
}
@@ -314,15 +316,15 @@
{
if (viewToRender == null)
{
- log.fatal("viewToRender must not be null");
+ log.severe("viewToRender must not be null");
throw new NullPointerException("viewToRender must not be null");
}
// do not render the view if the rendered attribute for the view is false
if (!viewToRender.isRendered())
{
- if (log.isTraceEnabled())
- log.trace("View is not rendered");
+ if (log.isLoggable(Level.FINEST))
+ log.finest("View is not rendered");
return;
}
@@ -330,8 +332,8 @@
String viewId = facesContext.getViewRoot().getViewId();
- if (log.isTraceEnabled())
- log.trace("Rendering JSP view: " + viewId);
+ if (log.isLoggable(Level.FINEST))
+ log.finest("Rendering JSP view: " + viewId);
ServletResponse response = (ServletResponse) externalContext.getResponse();
ServletRequest request = (ServletRequest) externalContext.getRequest();