logging for renderkit package and fix for Issue 129
M com/sun/faces/application/ActionListenerImpl.java
M com/sun/faces/application/ApplicationAssociate.java
M com/sun/faces/application/ApplicationFactoryImpl.java
M com/sun/faces/application/ApplicationImpl.java
Fix for Issue 129. Throw ISE if Variable/PropertyResolvers are
set after application init time.
M com/sun/faces/application/NavigationHandlerImpl.java
M com/sun/faces/application/StateManagerImpl.java
M com/sun/faces/application/ViewHandlerImpl.java
Change the logger name to include name of the package.
M com/sun/faces/renderkit/ByteArrayGuard.java
M com/sun/faces/renderkit/ResponseStateManagerImpl.java
M com/sun/faces/renderkit/html_basic/ButtonRenderer.java
M com/sun/faces/renderkit/html_basic/CheckboxRenderer.java
M com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java
M com/sun/faces/renderkit/html_basic/FormRenderer.java
M com/sun/faces/renderkit/html_basic/GridRenderer.java
M com/sun/faces/renderkit/html_basic/GroupRenderer.java
M com/sun/faces/renderkit/html_basic/HtmlBasicInputRenderer.java
M com/sun/faces/renderkit/html_basic/HtmlBasicRenderer.java
M com/sun/faces/renderkit/html_basic/ImageRenderer.java
M com/sun/faces/renderkit/html_basic/LabelRenderer.java
M com/sun/faces/renderkit/html_basic/MenuRenderer.java
M com/sun/faces/renderkit/html_basic/MessageRenderer.java
M com/sun/faces/renderkit/html_basic/MessagesRenderer.java
M com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java
M com/sun/faces/renderkit/html_basic/OutputMessageRenderer.java
M com/sun/faces/renderkit/html_basic/TableRenderer.java
M com/sun/faces/taglib/html_basic/ColumnTag.java
M com/sun/faces/taglib/jsf_core/ActionListenerTag.java
M com/sun/faces/taglib/jsf_core/ConvertDateTimeTag.java
M com/sun/faces/taglib/jsf_core/ValueChangeListenerTag.java
M com/sun/faces/taglib/jsf_core/ViewTag.java
M com/sun/faces/util/Util.java
move renderkit package to JDK 1.4 logging from commons-logging.
Index: com/sun/faces/application/ActionListenerImpl.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ActionListenerImpl.java,v
retrieving revision 1.11
diff -u -r1.11 ActionListenerImpl.java
--- com/sun/faces/application/ActionListenerImpl.java 5 Apr 2005 20:25:13 -0000 1.11
+++ com/sun/faces/application/ActionListenerImpl.java 9 Jun 2005 18:12:28 -0000
@@ -39,10 +39,8 @@
public class ActionListenerImpl implements ActionListener {
// Log instance for this class
- private static Logger logger;
- static {
- logger = Util.getLogger(Util.FACES_LOGGER);
- }
+ private static Logger logger = Util.getLogger(Util.FACES_LOGGER
+ + Util.APPLICATION_LOGGER);
//
// Constructors and Initializers
Index: com/sun/faces/application/ApplicationAssociate.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ApplicationAssociate.java,v
retrieving revision 1.11
diff -u -r1.11 ApplicationAssociate.java
--- com/sun/faces/application/ApplicationAssociate.java 16 May 2005 20:16:14 -0000 1.11
+++ com/sun/faces/application/ApplicationAssociate.java 9 Jun 2005 18:12:28 -0000
@@ -45,10 +45,8 @@
public class ApplicationAssociate extends Object {
// Log instance for this class
- private static Logger logger;
- static {
- logger = Util.getLogger(Util.FACES_LOGGER);
- }
+ private static Logger logger = Util.getLogger(Util.FACES_LOGGER
+ + Util.APPLICATION_LOGGER);
private ApplicationImpl app = null;
Index: com/sun/faces/application/ApplicationFactoryImpl.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ApplicationFactoryImpl.java,v
retrieving revision 1.8
diff -u -r1.8 ApplicationFactoryImpl.java
--- com/sun/faces/application/ApplicationFactoryImpl.java 5 Apr 2005 20:25:13 -0000 1.8
+++ com/sun/faces/application/ApplicationFactoryImpl.java 9 Jun 2005 18:12:28 -0000
@@ -31,10 +31,8 @@
public class ApplicationFactoryImpl extends ApplicationFactory {
// Log instance for this class
- private static Logger logger;
- static {
- logger = Util.getLogger(Util.FACES_LOGGER);
- }
+ private static Logger logger = Util.getLogger(Util.FACES_LOGGER
+ + Util.APPLICATION_LOGGER);
//
// Protected Constants
//
Index: com/sun/faces/application/ApplicationImpl.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ApplicationImpl.java,v
retrieving revision 1.61
diff -u -r1.61 ApplicationImpl.java
--- com/sun/faces/application/ApplicationImpl.java 16 May 2005 20:16:15 -0000 1.61
+++ com/sun/faces/application/ApplicationImpl.java 9 Jun 2005 18:12:28 -0000
@@ -68,10 +68,8 @@
public class ApplicationImpl extends Application {
// Log instance for this class
- private static Logger logger;
- static {
- logger = Util.getLogger(Util.FACES_LOGGER);
- }
+ private static Logger logger = Util.getLogger(Util.FACES_LOGGER
+ + Util.APPLICATION_LOGGER);
private static final ELContextListener[] EMPTY_EL_CTX_LIST_ARRAY = { };
@@ -386,6 +384,13 @@
public void setPropertyResolver(PropertyResolver resolver) {
+ // Throw Illegal State Exception if a PropertyResolver is set after
+ // application initialization has completed.
+ if (FacesContext.getCurrentInstance() != null) {
+ throw new IllegalStateException(
+ Util.getExceptionMessageString(
+ Util.APPLICATION_INIT_COMPLETE_ERROR_ID));
+ }
if (resolver == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
@@ -466,6 +471,13 @@
public void setVariableResolver(VariableResolver resolver) {
+ // Throw Illegal State Exception if VariableResolver is set after
+ // application initialization has completed.
+ if (FacesContext.getCurrentInstance() != null) {
+ throw new IllegalStateException(
+ Util.getExceptionMessageString(
+ Util.APPLICATION_INIT_COMPLETE_ERROR_ID));
+ }
if (resolver == null) {
String message = Util.getExceptionMessageString
(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID);
Index: com/sun/faces/application/NavigationHandlerImpl.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/NavigationHandlerImpl.java,v
retrieving revision 1.37
diff -u -r1.37 NavigationHandlerImpl.java
--- com/sun/faces/application/NavigationHandlerImpl.java 16 May 2005 20:16:15 -0000 1.37
+++ com/sun/faces/application/NavigationHandlerImpl.java 9 Jun 2005 18:12:28 -0000
@@ -41,10 +41,8 @@
//
// Log instance for this class
- private static Logger logger;
- static {
- logger = Util.getLogger(Util.FACES_LOGGER);
- }
+ private static Logger logger = Util.getLogger(Util.FACES_LOGGER
+ + Util.APPLICATION_LOGGER);
//
// Class Variables
Index: com/sun/faces/application/StateManagerImpl.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/StateManagerImpl.java,v
retrieving revision 1.31
diff -u -r1.31 StateManagerImpl.java
--- com/sun/faces/application/StateManagerImpl.java 6 Jun 2005 18:04:45 -0000 1.31
+++ com/sun/faces/application/StateManagerImpl.java 9 Jun 2005 18:12:28 -0000
@@ -43,10 +43,8 @@
public class StateManagerImpl extends StateManager {
// Log instance for this class
- private static Logger logger;
- static {
- logger = Util.getLogger(Util.FACES_LOGGER);
- }
+ private static Logger logger = Util.getLogger(Util.FACES_LOGGER
+ + Util.APPLICATION_LOGGER);
private static final String NUMBER_OF_VIEWS_IN_SESSION =
RIConstants.FACES_PREFIX + "NUMBER_OF_VIEWS_IN_SESSION";
Index: com/sun/faces/application/ViewHandlerImpl.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/application/ViewHandlerImpl.java,v
retrieving revision 1.53
diff -u -r1.53 ViewHandlerImpl.java
--- com/sun/faces/application/ViewHandlerImpl.java 21 May 2005 00:01:04 -0000 1.53
+++ com/sun/faces/application/ViewHandlerImpl.java 9 Jun 2005 18:12:28 -0000
@@ -56,10 +56,8 @@
public class ViewHandlerImpl extends ViewHandler {
// Log instance for this class
- private static Logger logger;
- static {
- logger = Util.getLogger(Util.FACES_LOGGER);
- }
+ private static Logger logger = Util.getLogger(Util.FACES_LOGGER
+ + Util.APPLICATION_LOGGER);
private static final String AFTER_VIEW_CONTENT = RIConstants.FACES_PREFIX+
"AFTER_VIEW_CONTENT";
Index: com/sun/faces/renderkit/ByteArrayGuard.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/ByteArrayGuard.java,v
retrieving revision 1.1
diff -u -r1.1 ByteArrayGuard.java
--- com/sun/faces/renderkit/ByteArrayGuard.java 20 Apr 2005 23:01:37 -0000 1.1
+++ com/sun/faces/renderkit/ByteArrayGuard.java 9 Jun 2005 18:12:28 -0000
@@ -45,10 +45,8 @@
public static final int DEFAULT_PASSWORD_LENGTH = 24;
// Log instance for this class
- private static Logger logger;
- static {
- logger = Util.getLogger(Util.FACES_LOGGER);
- }
+ protected static Logger logger =
+ Util.getLogger(Util.FACES_LOGGER + Util.RENDERKIT_LOGGER);
/**
* @param ps the password strategy to create password for encryption and decryption
Index: com/sun/faces/renderkit/ResponseStateManagerImpl.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/ResponseStateManagerImpl.java,v
retrieving revision 1.20
diff -u -r1.20 ResponseStateManagerImpl.java
--- com/sun/faces/renderkit/ResponseStateManagerImpl.java 16 May 2005 20:16:23 -0000 1.20
+++ com/sun/faces/renderkit/ResponseStateManagerImpl.java 9 Jun 2005 18:12:28 -0000
@@ -29,8 +29,8 @@
import com.sun.faces.util.Base64;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
@@ -42,8 +42,9 @@
//
// Protected Constants
//
- private static final Log log =
- LogFactory.getLog(ResponseStateManagerImpl.class);
+ // Log instance for this class
+ protected static Logger logger =
+ Util.getLogger(Util.FACES_LOGGER + Util.RENDERKIT_LOGGER);
private static final String FACES_VIEW_STATE =
"com.sun.faces.FACES_VIEW_STATE";
@@ -130,8 +131,8 @@
(Base64.decode(viewString.getBytes())));
bis = new ByteArrayInputStream(bytes);
if (isCompressStateSet(context)) {
- if (log.isDebugEnabled()) {
- log.debug("Deflating state before restoring..");
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Deflating state before restoring..");
}
gis = new GZIPInputStream(bis);
ois = new ObjectInputStream(gis);
@@ -151,11 +152,11 @@
}
ois.close();
} catch (java.io.OptionalDataException ode) {
- log.error(ode.getMessage(), ode);
+ logger.log(Level.SEVERE, ode.getMessage(), ode);
} catch (java.lang.ClassNotFoundException cnfe) {
- log.error(cnfe.getMessage(), cnfe);
+ logger.log(Level.SEVERE,cnfe.getMessage(), cnfe);
} catch (java.io.IOException iox) {
- log.error(iox.getMessage(), iox);
+ logger.log(Level.SEVERE,iox.getMessage(), iox);
}
}
else {
@@ -183,8 +184,8 @@
ByteArrayOutputStream bos = new ByteArrayOutputStream();
if (compress) {
- if (log.isDebugEnabled()) {
- log.debug("Compressing state before saving..");
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Compressing state before saving..");
}
zos = new GZIPOutputStream(bos);
oos = new ObjectOutputStream(zos);
Index: com/sun/faces/renderkit/html_basic/ButtonRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/ButtonRenderer.java,v
retrieving revision 1.87
diff -u -r1.87 ButtonRenderer.java
--- com/sun/faces/renderkit/html_basic/ButtonRenderer.java 1 Jun 2005 14:03:34 -0000 1.87
+++ com/sun/faces/renderkit/html_basic/ButtonRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -25,8 +25,8 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* <B>ButtonRenderer</B> is a class that renders the current value of
@@ -38,9 +38,6 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(ButtonRenderer.class);
-
//
// Class Variables
//
@@ -80,15 +77,16 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin decoding component " + component.getId());
}
// If the component is disabled, do not change the value of the
// component, since its state cannot be changed.
if (Util.componentIsDisabledOnReadonly(component)) {
- if (log.isTraceEnabled()) {
- log.trace("No decoding necessary since the component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No decoding necessary since the component " +
component.getId() + " is disabled");
}
return;
@@ -118,12 +116,13 @@
ActionEvent actionEvent = new ActionEvent(component);
component.queueEvent(actionEvent);
- if (log.isDebugEnabled()) {
- log.debug("This command resulted in form submission " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("This command resulted in form submission " +
" ActionEvent queued " + actionEvent);
}
- if (log.isTraceEnabled()) {
- log.trace("End decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "End decoding component " + component.getId());
}
return;
}
@@ -135,14 +134,15 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin encoding component " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId() +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " + component.getId() +
" since rendered attribute is set to false ");
}
return;
@@ -207,8 +207,9 @@
writer.writeAttribute("class", styleClass, "styleClass");
}
writer.endElement("input");
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "End encoding component " + component.getId());
}
}
Index: com/sun/faces/renderkit/html_basic/CheckboxRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/CheckboxRenderer.java,v
retrieving revision 1.72
diff -u -r1.72 CheckboxRenderer.java
--- com/sun/faces/renderkit/html_basic/CheckboxRenderer.java 16 May 2005 20:16:25 -0000 1.72
+++ com/sun/faces/renderkit/html_basic/CheckboxRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -22,8 +22,9 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
/**
* <B>CheckboxRenderer</B> is a class that renders the current value of
@@ -35,8 +36,6 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(CheckboxRenderer.class);
//
// Class Variables
@@ -79,8 +78,9 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin decoding component " + component.getId());
}
// If the checkbox disabled, nothing would be sent in the
@@ -88,8 +88,8 @@
// value of the checkbox, if it is disabled since its state
// cannot be changed.
if (Util.componentIsDisabledOnReadonly(component)) {
- if (log.isTraceEnabled()) {
- log.trace("No decoding necessary since the component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No decoding necessary since the component " +
component.getId() + " is disabled");
}
return;
@@ -115,11 +115,12 @@
}
setSubmittedValue(component, newValue);
- if (log.isTraceEnabled()) {
- log.trace("new value after decoding" + newValue);
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("new value after decoding" + newValue);
}
- if (log.isTraceEnabled()) {
- log.trace("End decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "End decoding component " + component.getId());
}
}
Index: com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java,v
retrieving revision 1.31
diff -u -r1.31 CommandLinkRenderer.java
--- com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java 16 May 2005 20:16:25 -0000 1.31
+++ com/sun/faces/renderkit/html_basic/CommandLinkRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -27,8 +27,8 @@
import com.sun.faces.RIConstants;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* <B>CommandLinkRenderer</B> is a class that renders the current value of
@@ -40,8 +40,6 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(CommandLinkRenderer.class);
// Separator character
@@ -84,8 +82,9 @@
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin decoding component " + component.getId());
}
UICommand command = (UICommand) component;
@@ -93,8 +92,8 @@
// If the component is disabled, do not change the value of the
// component, since its state cannot be changed.
if (Util.componentIsDisabledOnReadonly(component)) {
- if (log.isTraceEnabled()) {
- log.trace("No decoding necessary since the component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No decoding necessary since the component " +
component.getId() + " is disabled");
}
return;
@@ -115,12 +114,13 @@
ActionEvent actionEvent = new ActionEvent(component);
component.queueEvent(actionEvent);
- if (log.isDebugEnabled()) {
- log.debug("This command resulted in form submission " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("This command resulted in form submission " +
" ActionEvent queued " + actionEvent);
}
- if (log.isTraceEnabled()) {
- log.trace("End decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "End decoding component " + component.getId());
}
return;
}
@@ -136,8 +136,9 @@
throw new NullPointerException(
Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin encoding component " + component.getId());
}
UICommand command = (UICommand)component;
@@ -145,8 +146,8 @@
// suppress rendering if "rendered" property on the command is
// false.
if (!command.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId() +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " + component.getId() +
" since " +
"rendered attribute is set to false ");
}
@@ -159,8 +160,8 @@
UIForm uiform = getMyForm(context, command);
if ( uiform == null ) {
- if (log.isErrorEnabled()) {
- log.error("component " + component.getId() +
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.warning("component " + component.getId() +
" must be enclosed inside a form ");
}
return;
@@ -263,8 +264,8 @@
if (value != null) {
label = value.toString();
}
- if (log.isTraceEnabled()) {
- log.trace("Value to be rendered " + value);
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Value to be rendered " + value);
}
if (label != null && label.length() != 0) {
writer.write(label);
@@ -281,14 +282,15 @@
throw new NullPointerException(
Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding children " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin encoding children " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId() +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " + component.getId() +
" since " +
"rendered attribute is set to false ");
}
@@ -303,8 +305,9 @@
}
kid.encodeEnd(context);
}
- if (log.isTraceEnabled()) {
- log.trace("End encoding children " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "End encoding children " + component.getId());
}
}
@@ -320,8 +323,8 @@
// suppress rendering if "rendered" property on the command is
// false.
if (!command.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId() +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " + component.getId() +
" since " +
"rendered attribute is set to false ");
}
@@ -344,8 +347,8 @@
UIForm uiform = getMyForm(context, command);
if ( uiform == null ) {
- if (log.isErrorEnabled()) {
- log.error("component " + component.getId() +
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.warning("component " + component.getId() +
" must be enclosed inside a form ");
}
return;
@@ -354,8 +357,9 @@
// will also be persisted which will cause the script to be not rendered
// during postback.
uiform.getAttributes().remove(DID_RENDER_SCRIPT);
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "End encoding component " + component.getId());
}
return;
@@ -492,8 +496,8 @@
parent = parent.getParent();
}
if (null == parent) {
- if (log.isErrorEnabled()) {
- log.error("component " + component.getId() +
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.warning("component " + component.getId() +
" must be enclosed inside a form ");
}
}
Index: com/sun/faces/renderkit/html_basic/FormRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/FormRenderer.java,v
retrieving revision 1.87
diff -u -r1.87 FormRenderer.java
--- com/sun/faces/renderkit/html_basic/FormRenderer.java 16 May 2005 20:16:26 -0000 1.87
+++ com/sun/faces/renderkit/html_basic/FormRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -21,8 +21,8 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* <B>FormRenderer</B> is a class that renders a <code>UIForm<code> as a Form.
@@ -33,8 +33,7 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(FormRenderer.class);
+
//
// Class Variables
//
@@ -73,8 +72,9 @@
// the indicator accordingly..
//
String clientId = component.getClientId(context);
- if (log.isTraceEnabled()) {
- log.trace("Begin decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin decoding component " + component.getId());
}
Map requestParameterMap = context.getExternalContext()
.getRequestParameterMap();
@@ -83,8 +83,9 @@
} else {
((UIForm) component).setSubmitted(false);
}
- if (log.isTraceEnabled()) {
- log.trace("End decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "End decoding component " + component.getId());
}
}
@@ -97,15 +98,15 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " +
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER, "Begin encoding component " +
component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -160,8 +161,8 @@
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -185,8 +186,8 @@
writer.endElement("input");
writer.endElement("form");
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER, "End encoding component " + component.getId());
}
}
Index: com/sun/faces/renderkit/html_basic/GridRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/GridRenderer.java,v
retrieving revision 1.35
diff -u -r1.35 GridRenderer.java
--- com/sun/faces/renderkit/html_basic/GridRenderer.java 16 May 2005 20:16:26 -0000 1.35
+++ com/sun/faces/renderkit/html_basic/GridRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -20,8 +20,8 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* <B>GridRenderer</B> is a class that renders <code>UIPanel</code> component
@@ -33,8 +33,6 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(GridRenderer.class);
//
// Class Variables
@@ -82,16 +80,16 @@
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " +
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER, "Begin encoding component " +
component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component "
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component "
+ component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -165,15 +163,15 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding children " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding children " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -243,8 +241,8 @@
}
writer.endElement("tbody");
writer.writeText("\n", null);
- if (log.isTraceEnabled()) {
- log.trace("End encoding children " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding children " + component.getId());
}
}
@@ -259,8 +257,8 @@
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -270,8 +268,8 @@
ResponseWriter writer = context.getResponseWriter();
writer.endElement("table");
writer.writeText("\n", null);
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " + component.getId());
}
}
Index: com/sun/faces/renderkit/html_basic/GroupRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/GroupRenderer.java,v
retrieving revision 1.24
diff -u -r1.24 GroupRenderer.java
--- com/sun/faces/renderkit/html_basic/GroupRenderer.java 16 May 2005 20:16:26 -0000 1.24
+++ com/sun/faces/renderkit/html_basic/GroupRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -10,8 +10,8 @@
package com.sun.faces.renderkit.html_basic;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -31,9 +31,7 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(GroupRenderer.class);
-
+
//
// Class Variables
//
@@ -73,15 +71,15 @@
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " +
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding component " +
component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -115,14 +113,14 @@
public void encodeChildren(FacesContext context, UIComponent component)
throws IOException {
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding children " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER, "Begin encoding children " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -134,8 +132,8 @@
while (kids.hasNext()) {
encodeRecursive(context, (UIComponent) kids.next());
}
- if (log.isTraceEnabled()) {
- log.trace("End encoding children " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding children " + component.getId());
}
}
@@ -150,8 +148,8 @@
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -168,8 +166,8 @@
writer.endElement("span");
}
}
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " +
component.getId());
}
Index: com/sun/faces/renderkit/html_basic/HtmlBasicInputRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/HtmlBasicInputRenderer.java,v
retrieving revision 1.28
diff -u -r1.28 HtmlBasicInputRenderer.java
--- com/sun/faces/renderkit/html_basic/HtmlBasicInputRenderer.java 16 May 2005 20:16:26 -0000 1.28
+++ com/sun/faces/renderkit/html_basic/HtmlBasicInputRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -23,8 +23,8 @@
import com.sun.faces.util.MessageFactory;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* <B>HtmlBasicInputRenderer</B> is a base class for implementing renderers
@@ -36,9 +36,7 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(HtmlBasicInputRenderer.class);
-
+
//
// Class Variables
//
@@ -70,8 +68,8 @@
public void setSubmittedValue(UIComponent component, Object value) {
if (component instanceof UIInput) {
((UIInput) component).setSubmittedValue(value);
- if (log.isDebugEnabled()) {
- log.debug("Set submitted value " + value + " on component ");
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Set submitted value " + value + " on component ");
}
}
@@ -81,8 +79,8 @@
protected Object getValue(UIComponent component) {
if (component instanceof ValueHolder) {
Object value = ((ValueHolder) component).getValue();
- if (log.isDebugEnabled()) {
- log.debug("component.getValue() returned " + value);
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("component.getValue() returned " + value);
}
return value;
}
@@ -114,8 +112,8 @@
if (converterType == null ||
converterType == String.class ||
converterType == Object.class) {
- if (log.isDebugEnabled()) {
- log.debug("No conversion necessary for " + submittedValue
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No conversion necessary for " + submittedValue
+ "and converterType " + converterType +
" while decoding component " + component.getId());
}
@@ -127,16 +125,16 @@
try {
Application application = context.getApplication();
converter = application.createConverter(converterType);
- if (log.isDebugEnabled()) {
- log.debug(
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(
"Created converter " + converter + "of type " +
converterType +
" while decoding component " +
component.getId());
}
} catch (Exception e) {
- if (log.isDebugEnabled()) {
- log.debug("Converter could not be instantiated for " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Converter could not be instantiated for " +
converterType + " while " +
"decoding component " + component.getId());
}
@@ -148,8 +146,8 @@
// figuring out the type. So for the selectOne and
// selectMany, converter has to be set if there is no
// valueExpression attribute set on the component.
- if (log.isDebugEnabled()) {
- log.debug("No conversion necessary for " + submittedValue +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No conversion necessary for " + submittedValue +
" while decoding component " + component.getId() +
"since there is no explicitly registered converter and " +
"component value is not bound to a model property ");
@@ -161,8 +159,8 @@
result = converter.getAsObject(context, component, newValue);
return result;
} else {
- if (log.isDebugEnabled()) {
- log.debug("Unexpected Converter exception " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Unexpected Converter exception " +
" while decoding component " + component.getId());
}
// throw converter exception.
Index: com/sun/faces/renderkit/html_basic/HtmlBasicRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/HtmlBasicRenderer.java,v
retrieving revision 1.93
diff -u -r1.93 HtmlBasicRenderer.java
--- com/sun/faces/renderkit/html_basic/HtmlBasicRenderer.java 8 Jun 2005 19:45:05 -0000 1.93
+++ com/sun/faces/renderkit/html_basic/HtmlBasicRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -13,8 +13,6 @@
import com.sun.faces.util.MessageFactory;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
@@ -36,6 +34,9 @@
import java.util.List;
import java.util.Map;
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
/**
* <B>HtmlBasicRenderer</B> is a base class for implementing renderers
* for HtmlBasicRenderKit.
@@ -50,9 +51,10 @@
//
// Class Variables
//
- private static final Log log = LogFactory.getLog(HtmlBasicRenderer.class);
+ // Log instance for this class
+ protected static Logger logger =
+ Util.getLogger(Util.FACES_LOGGER + Util.RENDERKIT_LOGGER);
-
//
// Instance Variables
//
@@ -72,7 +74,7 @@
public static final String CLEAR_HIDDEN_FIELD_FN_NAME =
"clearFormHiddenParams";
-
+
public HtmlBasicRenderer() {
super();
}
@@ -101,15 +103,16 @@
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin decoding component " + component.getId());
}
if (!(component instanceof UIInput)) {
// decode needs to be invoked only for components that are
// instances or subclasses of UIInput.
- if (log.isTraceEnabled()) {
- log.trace("No decoding necessary since the component "
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No decoding necessary since the component "
+ component.getId() +
" is not an instance or a sub class of UIInput");
}
@@ -119,8 +122,8 @@
// If the component is disabled, do not change the value of the
// component, since its state cannot be changed.
if (Util.componentIsDisabledOnReadonly(component)) {
- if (log.isTraceEnabled()) {
- log.trace("No decoding necessary since the component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No decoding necessary since the component " +
component.getId() + " is disabled");
}
return;
@@ -133,12 +136,13 @@
if (requestMap.containsKey(clientId)) {
String newValue = (String) requestMap.get(clientId);
setSubmittedValue(component, newValue);
- if (log.isTraceEnabled()) {
- log.trace("new value after decoding" + newValue);
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("new value after decoding" + newValue);
}
}
- if (log.isTraceEnabled()) {
- log.trace("End decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "End decoding component " + component.getId());
}
}
@@ -158,15 +162,16 @@
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,
+ "Begin encoding component " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId() +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " + component.getId() +
" since " +
"rendered attribute is set to false ");
}
@@ -177,8 +182,8 @@
assert (writer != null);
currentValue = getCurrentValue(context, component);
- if (log.isTraceEnabled()) {
- log.trace("Value to be rendered " + currentValue);
+ if (logger.isLoggable(Level.FINE)) {
+ logger.log(Level.FINE, "Value to be rendered " + currentValue);
}
getEndTextToRender(context, component, currentValue);
}
@@ -419,8 +424,8 @@
// log a message if we were unable to find the specified
// component (probably a misconfigured 'for' attribute
if (result == null) {
- if (log.isWarnEnabled()) {
- log.warn(Util.getExceptionMessageString(
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.warning(Util.getExceptionMessageString(
Util.COMPONENT_NOT_FOUND_IN_VIEW_WARNING_ID,
new Object[]{forComponent}));
}
@@ -499,9 +504,9 @@
writer.writeAttribute("id", id = component.getClientId(context),
"id");
} catch (IOException e) {
- if (log.isDebugEnabled()) {
+ if (logger.isLoggable(Level.WARNING)) {
// PENDING I18N
- log.debug("Can't write ID attribute" + e.getMessage());
+ logger.warning("Can't write ID attribute" + e.getMessage());
}
}
}
Index: com/sun/faces/renderkit/html_basic/ImageRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/ImageRenderer.java,v
retrieving revision 1.38
diff -u -r1.38 ImageRenderer.java
--- com/sun/faces/renderkit/html_basic/ImageRenderer.java 16 May 2005 20:16:27 -0000 1.38
+++ com/sun/faces/renderkit/html_basic/ImageRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -13,8 +13,8 @@
import com.sun.faces.util.Util;
import com.sun.faces.RIConstants;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import javax.faces.component.UIComponent;
import javax.faces.component.UIGraphic;
@@ -35,9 +35,7 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(ImageRenderer.class);
-
+
//
// Class Variables
//
@@ -90,14 +88,14 @@
Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding component " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -124,8 +122,8 @@
writer.writeAttribute("class", styleClass, "styleClass");
}
writer.endElement("img");
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " + component.getId());
}
}
Index: com/sun/faces/renderkit/html_basic/LabelRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/LabelRenderer.java,v
retrieving revision 1.37
diff -u -r1.37 LabelRenderer.java
--- com/sun/faces/renderkit/html_basic/LabelRenderer.java 16 May 2005 20:16:27 -0000 1.37
+++ com/sun/faces/renderkit/html_basic/LabelRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -20,8 +20,8 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* <p><B>LabelRenderer</B> renders Label element.<p>.
@@ -31,7 +31,6 @@
//
// Protected Constants
//
- private static final Log log = LogFactory.getLog(LabelRenderer.class);
//
// Class Variables
//
@@ -73,8 +72,8 @@
Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin decoding component " + component.getId());
}
ResponseWriter writer = null;
String forValue = null;
@@ -84,8 +83,8 @@
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -126,8 +125,8 @@
// render the curentValue as label text if specified.
String value = getCurrentValue(context, component);
- if (log.isTraceEnabled()) {
- log.trace("Value to be rendered " + value);
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Value to be rendered " + value);
}
if (value != null && value.length() != 0) {
boolean escape = true;
@@ -171,8 +170,8 @@
assert (writer != null);
writer.endElement("label");
}
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " + component.getId());
}
}
@@ -201,8 +200,8 @@
parent = parent.getParent();
}
if (parent == null) {
- if (log.isErrorEnabled()) {
- log.error("component " + component.getId() +
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.warning("component " + component.getId() +
" must be enclosed inside a form ");
}
return result;
Index: com/sun/faces/renderkit/html_basic/MenuRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/MenuRenderer.java,v
retrieving revision 1.58
diff -u -r1.58 MenuRenderer.java
--- com/sun/faces/renderkit/html_basic/MenuRenderer.java 16 May 2005 20:16:28 -0000 1.58
+++ com/sun/faces/renderkit/html_basic/MenuRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -37,8 +37,8 @@
import com.sun.faces.RIConstants;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* <B>MenuRenderer</B> is a class that renders the current value of
@@ -55,9 +55,7 @@
//
// Class Variables
//
-
- private static final Log log = LogFactory.getLog(MenuRenderer.class);
-
+
//
// Instance Variables
//
@@ -91,15 +89,15 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin decoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin decoding component " + component.getId());
}
// If the component is disabled, do not change the value of the
// component, since its state cannot be changed.
if (Util.componentIsDisabledOnReadonly(component)) {
- if (log.isTraceEnabled()) {
- log.trace("No decoding necessary since the component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No decoding necessary since the component " +
component.getId() + " is disabled");
}
return;
@@ -116,16 +114,16 @@
String newValues[] = (String[]) requestParameterValuesMap.
get(clientId);
setSubmittedValue(component, newValues);
- if (log.isTraceEnabled()) {
- log.trace("submitted values for UISelectMany component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("submitted values for UISelectMany component " +
component.getId() + " after decoding " + newValues);
}
} else {
-// Use the empty array, not null, to distinguish
-// between an deselected UISelectMany and a disabled one
+ // Use the empty array, not null, to distinguish
+ // between an deselected UISelectMany and a disabled one
setSubmittedValue(component, new String[0]);
- if (log.isTraceEnabled()) {
- log.trace("Set empty array for UISelectMany component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Set empty array for UISelectMany component " +
component.getId() + " after decoding ");
}
}
@@ -136,8 +134,8 @@
if (requestParameterMap.containsKey(clientId)) {
String newValue = (String) requestParameterMap.get(clientId);
setSubmittedValue(component, newValue);
- if (log.isTraceEnabled()) {
- log.trace("submitted value for UISelectOne component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("submitted value for UISelectOne component " +
component.getId() + " after decoding " + newValue);
}
@@ -176,8 +174,8 @@
return null;
}
if (newValue == null) {
- if (log.isTraceEnabled()) {
- log.trace("No conversion necessary for SelectOne Component "
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No conversion necessary for SelectOne Component "
+ uiSelectOne.getId() + " since the new value is null ");
}
return null;
@@ -185,8 +183,8 @@
convertedValue =
super.getConvertedValue(context, uiSelectOne, newValue);
- if (log.isTraceEnabled()) {
- log.trace("SelectOne Component " + uiSelectOne.getId() +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("SelectOne Component " + uiSelectOne.getId() +
" convertedValue " + convertedValue);
}
return convertedValue;
@@ -250,8 +248,8 @@
// At this point, result is ready to be set as the value
- if (log.isTraceEnabled()) {
- log.trace("SelectMany Component " + uiSelectMany.getId() +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("SelectMany Component " + uiSelectMany.getId() +
" convertedValues " + result);
}
return result;
@@ -292,10 +290,10 @@
// attached converter takes priority
if (null == (converter = uiSelectMany.getConverter())) {
-// Otherwise, look for a by-type converter
+ // Otherwise, look for a by-type converter
if (null == (converter = Util.getConverterForClass(elementType))) {
-// if that fails, and the attached values are of Object type,
-// we don't need conversion.
+ // if that fails, and the attached values are of Object type,
+ // we don't need conversion.
if (elementType.equals(Object.class)) {
return newValues;
}
@@ -364,11 +362,11 @@
}
} else {
for (int i = 0; i < len; i++) {
- if (log.isDebugEnabled()) {
+ if (logger.isLoggable(Level.FINE)) {
Object converted = converter.getAsObject(context,
uiSelectMany,
newValues[i]);
- log.debug("String value: " + newValues[i] +
+ logger.fine("String value: " + newValues[i] +
" converts to : " + converted.toString());
}
Array.set(result, i, converter.getAsObject(context,
@@ -410,14 +408,14 @@
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding component " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -425,8 +423,8 @@
}
renderSelect(context, component);
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " + component.getId());
}
}
@@ -439,8 +437,8 @@
ResponseWriter writer = context.getResponseWriter();
assert (writer != null);
- if (log.isTraceEnabled()) {
- log.trace("Rendering 'select'");
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Rendering 'select'");
}
writer.startElement("select", component);
writeIdAttributeIfNecessary(context, writer, component);
@@ -460,8 +458,8 @@
// the component's "size" attribute accordingly; The "size"
// attribute will be rendered as one of the "pass thru" attributes
int itemCount = getOptionNumber(context, component);
- if (log.isTraceEnabled()) {
- log.trace("Rendering " + itemCount + " options");
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Rendering " + itemCount + " options");
}
// If "size" is *not* set explicitly, we have to default it correctly
Object size = component.getAttributes().get("size");
Index: com/sun/faces/renderkit/html_basic/MessageRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/MessageRenderer.java,v
retrieving revision 1.52
diff -u -r1.52 MessageRenderer.java
--- com/sun/faces/renderkit/html_basic/MessageRenderer.java 21 Apr 2005 18:55:36 -0000 1.52
+++ com/sun/faces/renderkit/html_basic/MessageRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -12,8 +12,8 @@
package com.sun.faces.renderkit.html_basic;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
@@ -36,7 +36,6 @@
//
// Private/Protected Constants
//
- private static final Log log = LogFactory.getLog(MessageRenderer.class);
//
// Ivars
@@ -97,14 +96,14 @@
omRenderer.encodeEnd(context, component);
return;
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding component " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -117,9 +116,8 @@
//"for" attribute required for Message. Should be taken care of
//by TLD in JSP case, but need to cover non-JSP case.
if (clientId == null) {
- if (log.isInfoEnabled()) {
- log.info(Util.getExceptionMessageString(
- Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.warning("'for' attribute cannot be null");
}
return;
}
@@ -251,8 +249,8 @@
writer.endElement("span");
}
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " + component.getId());
}
}
Index: com/sun/faces/renderkit/html_basic/MessagesRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/MessagesRenderer.java,v
retrieving revision 1.21
diff -u -r1.21 MessagesRenderer.java
--- com/sun/faces/renderkit/html_basic/MessagesRenderer.java 21 Apr 2005 18:55:37 -0000 1.21
+++ com/sun/faces/renderkit/html_basic/MessagesRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -12,8 +12,8 @@
package com.sun.faces.renderkit.html_basic;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
@@ -35,7 +35,6 @@
//
// Prviate/Protected Constants
//
- private static final Log log = LogFactory.getLog(MessagesRenderer.class);
//
// Methods From Renderer
@@ -61,14 +60,14 @@
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component "
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component "
+ component.getId() + " since " +
"rendered attribute is set to false ");
}
Index: com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java,v
retrieving revision 1.19
diff -u -r1.19 OutputLinkRenderer.java
--- com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java 8 Jun 2005 19:45:05 -0000 1.19
+++ com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -21,8 +21,8 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
@@ -38,8 +38,6 @@
//
// Protected Constants
//
- // Log instance for this class
- private static final Log log = LogFactory.getLog(OutputLinkRenderer.class);
// Separator character
@@ -79,8 +77,8 @@
}
// take no action, this is an Output component.
- if (log.isTraceEnabled()) {
- log.trace("No decoding necessary since the component "
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No decoding necessary since the component "
+ component.getId() +
" is not an instance or a sub class of UIInput");
}
@@ -104,21 +102,21 @@
throw new NullPointerException(
Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding component " + component.getId());
}
UIOutput output = (UIOutput) component;
String hrefVal = getCurrentValue(context, component);
- if (log.isTraceEnabled()) {
- log.trace("Value to be rendered " + hrefVal);
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Value to be rendered " + hrefVal);
}
// suppress rendering if "rendered" property on the output is
// false
if (!output.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component "
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component "
+ component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -179,14 +177,14 @@
throw new NullPointerException(
Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding children " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding children " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component "
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component "
+ component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -211,14 +209,14 @@
Util.getExceptionMessageString(Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("End encoding " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component "
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component "
+ component.getId() + " since " +
"rendered attribute is set to false ");
}
Index: com/sun/faces/renderkit/html_basic/OutputMessageRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/OutputMessageRenderer.java,v
retrieving revision 1.19
diff -u -r1.19 OutputMessageRenderer.java
--- com/sun/faces/renderkit/html_basic/OutputMessageRenderer.java 21 Apr 2005 18:55:37 -0000 1.19
+++ com/sun/faces/renderkit/html_basic/OutputMessageRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -12,8 +12,8 @@
package com.sun.faces.renderkit.html_basic;
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import javax.faces.component.UIComponent;
import javax.faces.component.UIParameter;
@@ -33,10 +33,6 @@
public class OutputMessageRenderer extends HtmlBasicRenderer {
- // Log instance for this class
- protected static final Log log = LogFactory.getLog(
- OutputMessageRenderer.class);
-
//
// Protected Constants
//
@@ -89,9 +85,10 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding component " + component.getId());
}
+
String
currentValue = null,
style = (String) component.getAttributes().get("style"),
@@ -103,8 +100,8 @@
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId() +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("End encoding component " + component.getId() +
" since rendered attribute is set to false");
}
return;
@@ -183,6 +180,10 @@
}
if (wroteSpan) {
writer.endElement("span");
+ }
+
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " + component.getId());
}
}
Index: com/sun/faces/renderkit/html_basic/TableRenderer.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/TableRenderer.java,v
retrieving revision 1.26
diff -u -r1.26 TableRenderer.java
--- com/sun/faces/renderkit/html_basic/TableRenderer.java 16 May 2005 20:16:29 -0000 1.26
+++ com/sun/faces/renderkit/html_basic/TableRenderer.java 9 Jun 2005 18:12:28 -0000
@@ -11,8 +11,8 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
@@ -30,11 +30,7 @@
*/
public class TableRenderer extends HtmlBasicRenderer {
-
- // Log instance for this class
- private static final Log log = LogFactory.getLog(ButtonRenderer.class);
-
-
+
public boolean getRendersChildren() {
return true;
}
@@ -47,15 +43,15 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding component " + component.getId());
}
// suppress rendering if "rendered" property on the component is
// false.
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("No encoding necessary " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No encoding necessary " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -188,12 +184,12 @@
throw new NullPointerException(Util.getExceptionMessageString(
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
- if (log.isTraceEnabled()) {
- log.trace("Begin encoding children " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"Begin encoding children " + component.getId());
}
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("No encoding necessary " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No encoding necessary " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -283,8 +279,8 @@
// Clean up after ourselves
data.setRowIndex(-1);
- if (log.isTraceEnabled()) {
- log.trace("End encoding children " +
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding children " +
component.getId());
}
}
@@ -298,8 +294,8 @@
Util.NULL_PARAMETERS_ERROR_MESSAGE_ID));
}
if (!component.isRendered()) {
- if (log.isTraceEnabled()) {
- log.trace("No encoding necessary " +
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("No encoding necessary " +
component.getId() + " since " +
"rendered attribute is set to false ");
}
@@ -312,8 +308,8 @@
// Render the ending of this table
writer.endElement("table");
writer.writeText("\n", null);
- if (log.isTraceEnabled()) {
- log.trace("End encoding component " + component.getId());
+ if (logger.isLoggable(Level.FINER)) {
+ logger.log(Level.FINER,"End encoding component " + component.getId());
}
}
Index: com/sun/faces/taglib/html_basic/ColumnTag.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/html_basic/ColumnTag.java,v
retrieving revision 1.10
diff -u -r1.10 ColumnTag.java
--- com/sun/faces/taglib/html_basic/ColumnTag.java 16 May 2005 20:16:31 -0000 1.10
+++ com/sun/faces/taglib/html_basic/ColumnTag.java 9 Jun 2005 18:12:28 -0000
@@ -18,15 +18,14 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
+import java.util.logging.Logger;
+import java.util.logging.Level;
public class ColumnTag extends UIComponentTag {
- private static final Log log = LogFactory.getLog(ColumnTag.class);
-
-
+ // Log instance for this class
+ protected static Logger logger =
+ Util.getLogger(Util.FACES_LOGGER + Util.TAGLIB_LOGGER);
//
// Instance Variables
@@ -98,13 +97,13 @@
try {
rc = super.doStartTag();
} catch (JspException e) {
- if (log.isDebugEnabled()) {
- log.debug(getDebugString(), e);
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.log(Level.WARNING, getDebugString(), e);
}
throw e;
} catch (Throwable t) {
- if (log.isDebugEnabled()) {
- log.debug(getDebugString(), t);
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.log(Level.WARNING, getDebugString(), t);
}
throw new JspException(t);
}
@@ -117,13 +116,13 @@
try {
rc = super.doEndTag();
} catch (JspException e) {
- if (log.isDebugEnabled()) {
- log.debug(getDebugString(), e);
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.log(Level.WARNING, getDebugString(), e);
}
throw e;
} catch (Throwable t) {
- if (log.isDebugEnabled()) {
- log.debug(getDebugString(), t);
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.log(Level.WARNING, getDebugString(), t);
}
throw new JspException(t);
}
Index: com/sun/faces/taglib/jsf_core/ActionListenerTag.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/jsf_core/ActionListenerTag.java,v
retrieving revision 1.21
diff -u -r1.21 ActionListenerTag.java
--- com/sun/faces/taglib/jsf_core/ActionListenerTag.java 19 May 2005 13:26:59 -0000 1.21
+++ com/sun/faces/taglib/jsf_core/ActionListenerTag.java 9 Jun 2005 18:12:28 -0000
@@ -23,8 +23,8 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
@@ -58,8 +58,8 @@
// ------------------------------------------------------------- Attributes
private static final long serialVersionUID = -5222351612904952740L;
- private static final Log log = LogFactory.getLog(ActionListenerTag.class);
-
+ protected static Logger logger =
+ Util.getLogger(Util.FACES_LOGGER + Util.TAGLIB_LOGGER);
/**
* <p>The fully qualified class name of the {_at_link ActionListener}
* instance to be created.</p>
@@ -176,11 +176,11 @@
if (handler != null) {
((ActionSource)component).addActionListener(handler);
} else {
- if (log.isDebugEnabled()) {
+ if (logger.isLoggable(Level.FINE)) {
if (binding == null && type == null) {
- log.debug("'handler' was not created because both 'binding' and 'type' were null.");
+ logger.fine("'handler' was not created because both 'binding' and 'type' were null.");
} else {
- log.debug("'handler' was not created.");
+ logger.fine("'handler' was not created.");
}
}
}
Index: com/sun/faces/taglib/jsf_core/ConvertDateTimeTag.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/jsf_core/ConvertDateTimeTag.java,v
retrieving revision 1.17
diff -u -r1.17 ConvertDateTimeTag.java
--- com/sun/faces/taglib/jsf_core/ConvertDateTimeTag.java 23 May 2005 14:38:33 -0000 1.17
+++ com/sun/faces/taglib/jsf_core/ConvertDateTimeTag.java 9 Jun 2005 18:12:28 -0000
@@ -37,9 +37,10 @@
private static final long serialVersionUID = -5815655767093677438L;
private static ValueExpression CONVERTER_ID_EXPR = null;
+
// Log instance for this class
- private static final Logger logger = Util.getLogger(Util.FACES_LOGGER);
-
+ protected static Logger logger =
+ Util.getLogger(Util.FACES_LOGGER + Util.TAGLIB_LOGGER);
//
// Instance Variables
Index: com/sun/faces/taglib/jsf_core/ValueChangeListenerTag.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/jsf_core/ValueChangeListenerTag.java,v
retrieving revision 1.15
diff -u -r1.15 ValueChangeListenerTag.java
--- com/sun/faces/taglib/jsf_core/ValueChangeListenerTag.java 20 May 2005 14:50:00 -0000 1.15
+++ com/sun/faces/taglib/jsf_core/ValueChangeListenerTag.java 9 Jun 2005 18:12:28 -0000
@@ -23,8 +23,8 @@
import com.sun.faces.util.Util;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* <p>Tag implementation that creates a {_at_link ValueChangeListener} instance
@@ -57,8 +57,8 @@
// ------------------------------------------------------------- Attributes
private static final long serialVersionUID = -212845116876281363L;
- private static final Log log =
- LogFactory.getLog(ValueChangeListenerTag.class);
+ protected static Logger logger =
+ Util.getLogger(Util.FACES_LOGGER + Util.TAGLIB_LOGGER);
/**
@@ -177,11 +177,11 @@
if (handler != null) {
((EditableValueHolder) component).addValueChangeListener(handler);
} else {
- if (log.isDebugEnabled()) {
+ if (logger.isLoggable(Level.FINE)) {
if (binding == null && type == null) {
- log.debug("'handler' was not created because both 'binding' and 'type' were null.");
+ logger.fine("'handler' was not created because both 'binding' and 'type' were null.");
} else {
- log.debug("'handler' was not created.");
+ logger.fine("'handler' was not created.");
}
}
}
Index: com/sun/faces/taglib/jsf_core/ViewTag.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/taglib/jsf_core/ViewTag.java,v
retrieving revision 1.36
diff -u -r1.36 ViewTag.java
--- com/sun/faces/taglib/jsf_core/ViewTag.java 16 May 2005 20:16:33 -0000 1.36
+++ com/sun/faces/taglib/jsf_core/ViewTag.java 9 Jun 2005 18:12:28 -0000
@@ -34,8 +34,8 @@
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTag;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.util.logging.Logger;
+import java.util.logging.Level;
import com.sun.faces.application.ViewHandlerResponseWrapper;
import com.sun.faces.util.Util;
@@ -59,7 +59,8 @@
// Class Variables
//
- private static final Log log = LogFactory.getLog(ViewTag.class);
+ protected static Logger logger =
+ Util.getLogger(Util.FACES_LOGGER + Util.TAGLIB_LOGGER);
//
// Instance Variables
@@ -157,15 +158,13 @@
try {
rc = super.doStartTag();
} catch (JspException e) {
- if (log.isDebugEnabled()) {
- log.debug("Can't leverage base class",
- e);
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.log(Level.WARNING, "Can't leverage base class", e);
}
throw e;
} catch (Throwable t) {
- if (log.isDebugEnabled()) {
- log.debug("Can't leverage base class",
- t);
+ if (logger.isLoggable(Level.WARNING)) {
+ logger.log(Level.WARNING, "Can't leverage base class", t);
}
throw new JspException(t);
}
Index: com/sun/faces/util/Util.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/util/Util.java,v
retrieving revision 1.162
diff -u -r1.162 Util.java
--- com/sun/faces/util/Util.java 1 Jun 2005 14:03:38 -0000 1.162
+++ com/sun/faces/util/Util.java 9 Jun 2005 18:12:28 -0000
@@ -77,15 +77,17 @@
"com.sun.faces.LogStrings";
// Log instance for this class
- private static Logger logger;
- static {
- logger = getLogger(FACES_LOGGER);
- }
+ private static Logger logger = getLogger(FACES_LOGGER);
// README - make sure to add the message identifier constant
// (ex: Util.CONVERSION_ERROR_MESSAGE_ID) and the number of substitution
// parameters to test/com/sun/faces/util/TestUtil_messages (see comment there).
+ // Loggers
+ public static final String RENDERKIT_LOGGER = "renderkit";
+ public static final String TAGLIB_LOGGER = "taglib";
+ public static final String APPLICATION_LOGGER = "application";
+
/**
* The message identifier of the {_at_link FacesMessage} to be created as
* a result of type conversion error.
Index: com/sun/faces/application/TestApplicationImpl.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/test/com/sun/faces/application/TestApp
licationImpl.java,v
retrieving revision 1.23
diff -u -r1.23 TestApplicationImpl.java
--- com/sun/faces/application/TestApplicationImpl.java 6 May 2005 22:02:04 -0000
1.23
+++ com/sun/faces/application/TestApplicationImpl.java 9 Jun 2005 18:25:45 -0000
@@ -122,7 +122,6 @@
// instance if called multiple times.
//
PropertyResolver propertyResolver1 = application.getPropertyResolver();
- application.setPropertyResolver(propertyResolver1);
PropertyResolver propertyResolver2 = application.getPropertyResolver();
PropertyResolver propertyResolver3 = application.getPropertyResolver();
assertTrue((propertyResolver1 == propertyResolver2) &&
@@ -132,7 +131,6 @@
// instance if called multiple times.
//
VariableResolver variableResolver1 = application.getVariableResolver();
- application.setVariableResolver(variableResolver1);
VariableResolver variableResolver2 = application.getVariableResolver();
VariableResolver variableResolver3 = application.getVariableResolver();
assertTrue((variableResolver1 == variableResolver2) &&
@@ -175,13 +173,12 @@
}
assertTrue(thrown);
- // 4. Verify NullPointer exception which occurs when attempting
- // to set a null PropertyResolver
- //
+ // 4. Verify ISE occurs when attempting to set PropertyResolver
+ // after application init time
thrown = false;
try {
application.setPropertyResolver(null);
- } catch (NullPointerException e) {
+ } catch (IllegalStateException e) {
thrown = true;
}
assertTrue(thrown);
@@ -197,13 +194,13 @@
}
assertTrue(thrown);
- // 6. Verify NullPointer exception which occurs when attempting
- // to set a null VariableResolver
+ // 6.Verify ISE occurs when attempting to set VariableResolver
+ // after application init time
//
thrown = false;
try {
application.setVariableResolver(null);
- } catch (NullPointerException e) {
+ } catch (IllegalStateException e) {
thrown = true;
}
assertTrue(thrown);