Author: ayanul
Date: 2008-04-09 13:59:16 -0400 (Wed, 09 Apr 2008)
New Revision: 7716
Added:
branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker/PhaseTrackerComponent.java
Log:
Added:
branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker/PhaseTrackerComponent.java
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker/PhaseTrackerComponent.java
(rev 0)
+++
branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker/PhaseTrackerComponent.java 2008-04-09
17:59:16 UTC (rev 7716)
@@ -0,0 +1,60 @@
+/**
+ *
+ */
+package util.phaseTracker;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Map;
+
+import javax.faces.component.UIPanel;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+/**
+ * @author user
+ *
+ */
+public class PhaseTrackerComponent extends UIPanel{
+
+// private String var;
+//
+// public String getVar() {
+// if (var == null) {
+// return "pttc";
+// }
+// return var;
+// }
+//
+// public void setVar(String var) {
+// this.var = var;
+// }
+
+
+ public void encodeAll(FacesContext context) throws IOException {
+ ResponseWriter responseWriter = context.getResponseWriter();
+ StringWriter stringWriter = new StringWriter();
+ ResponseWriter clonedWriter = responseWriter.cloneWithWriter(stringWriter);
+ context.setResponseWriter(clonedWriter);
+
+ clonedWriter.flush();
+ context.setResponseWriter(responseWriter);
+
+ String string = stringWriter.toString();
+ responseWriter.write(string);
+ //System.out.println(string);
+
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, Object> requestMap = externalContext.getRequestMap();
+ requestMap.put("pttc", string);
+// requestMap.put(getAttributes().get("var"), string);
+ }
+
+ @Override
+ public String getRendererType() {
+ return null;
+ }
+
+
+}
Show replies by date