Author: piotr.buda
Date: 2008-11-17 06:23:41 -0500 (Mon, 17 Nov 2008)
New Revision: 11186
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java
Log:
Added logging to state saving
Modified:
trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java
===================================================================
---
trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java 2008-11-17
11:23:21 UTC (rev 11185)
+++
trunk/ui/extendedDataTable/src/main/java/org/richfaces/component/ExtendedDataTableState.java 2008-11-17
11:23:41 UTC (rev 11186)
@@ -16,6 +16,8 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.richfaces.json.JSONArray;
import org.richfaces.json.JSONCollection;
import org.richfaces.json.JSONException;
@@ -32,6 +34,8 @@
public class ExtendedDataTableState implements Serializable {
private static final long serialVersionUID = -3103664821855261335L;
+
+ private static final Log log = LogFactory.getLog(ExtendedDataTableState.class);
public static final String TABLE_STATE_ATTR_NAME = "tableState";
@@ -61,7 +65,10 @@
try {
stateMap = new JSONMap(value);
} catch (JSONException e) {
- e.printStackTrace();
+ log.error("Could not initialize table state");
+ if(log.isDebugEnabled()) {
+ log.debug(e);
+ }
}
}
//initialize columns order part
@@ -99,7 +106,10 @@
result.put("columnsSizeState", columnsSizeState.toJSON());
result.put("columnGroupingState", columnGroupingState.toJSON());
} catch (JSONException e) {
- e.printStackTrace();
+ log.error("Could not convert to JSON");
+ if(log.isDebugEnabled()) {
+ log.debug(e);
+ }
}
return result;
}
@@ -221,6 +231,8 @@
class ColumnsSizeState implements Serializable{
private static final long serialVersionUID = 8724163192351491340L;
+
+ private static final Log log = LogFactory.getLog(ExtendedDataTableState.class);
private static final String DEFAULT_WIDTH = "100";
@@ -286,7 +298,12 @@
}
value = new JSONMap(writer.endObject().toString());
} catch (JSONException e) {
- e.printStackTrace();
+ if(log.isWarnEnabled()) {
+ log.warn("Default column size state not created");
+ }
+ if(log.isDebugEnabled()) {
+ log.debug(e);
+ }
}
}
Show replies by date