myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dennisby...@apache.org
Subject svn commit: r413821 - in /myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit: RendererUtils.java _SharedRendererUtils.java html/HtmlTextRendererBase.java
Date Tue, 13 Jun 2006 07:11:49 GMT
Author: dennisbyrne
Date: Tue Jun 13 00:11:49 2006
New Revision: 413821

URL: http://svn.apache.org/viewvc?rev=413821&view=rev
Log:
MYFACES-1250

Modified:
    myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
    myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/_SharedRendererUtils.java
    myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java

Modified: myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java?rev=413821&r1=413820&r2=413821&view=diff
==============================================================================
--- myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
(original)
+++ myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
Tue Jun 13 00:11:49 2006
@@ -204,6 +204,7 @@
                 {
                     if (submittedValue instanceof String)
                     {
+                    	log.info("returning 1 '" + submittedValue + "'");
                         return (String)submittedValue;
                     }
                     else
@@ -219,14 +220,11 @@
             Converter converter = ((ValueHolder)component).getConverter();
             if (converter == null  && value != null)
             {
-                if (value instanceof String)
-                {
-                    return (String) value;
-                }
 
                 try
                 {
                     converter = facesContext.getApplication().createConverter(value.getClass());
+                    log.info("the created converter is " + converter);
                 }
                 catch (FacesException e)
                 {
@@ -239,15 +237,18 @@
             {
                 if (value == null)
                 {
+                	log.info("returning an empty string");
                     return "";
                 }
                 else
                 {
+                	log.info("returning an .toString");
                     return value.toString();
                 }
             }
             else
             {
+            	log.info("returning converter get as string " + converter);
                 return converter.getAsString(facesContext, component, value);
             }
         }
@@ -353,8 +354,6 @@
                 SelectItem selectItem = (SelectItem) selectItems.get(0);
                 Class listComponentType = selectItem.getValue().getClass();
 
-                if (!(String.class.equals(listComponentType)))
-                {
                     try
                     {
                         return facesContext.getApplication().createConverter(listComponentType);
@@ -364,7 +363,7 @@
                         log.error("No Converter for type " + listComponentType.getName()
+ " found", e);
                         return null;
                     }
-                }
+
             }
 
             return null;
@@ -376,7 +375,6 @@
         }
 
         Class arrayComponentType = valueType.getComponentType();
-        if (String.class.equals(arrayComponentType)) return null;    //No converter needed
for String type
         if (Object.class.equals(arrayComponentType)) return null;    //There is no converter
for Object class
 
         try

Modified: myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/_SharedRendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/_SharedRendererUtils.java?rev=413821&r1=413820&r2=413821&view=diff
==============================================================================
--- myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/_SharedRendererUtils.java
(original)
+++ myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/_SharedRendererUtils.java
Tue Jun 13 00:11:49 2006
@@ -55,7 +55,6 @@
         Class valueType = vb.getType(facesContext);
         if (valueType == null) return null;
 
-        if (String.class.equals(valueType)) return null;    //No converter needed for String
type
         if (Object.class.equals(valueType)) return null;    //There is no converter for Object
class
 
         try
@@ -121,7 +120,6 @@
                 throw new IllegalArgumentException("ValueBinding for UISelectMany must be
of type List or Array");
             }
 
-            if (String.class.equals(arrayComponentType)) return submittedValue; //No conversion
needed for String type
             if (Object.class.equals(arrayComponentType)) return submittedValue; //No conversion
for Object class
 
             try

Modified: myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java?rev=413821&r1=413820&r2=413821&view=diff
==============================================================================
--- myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
(original)
+++ myfaces/shared/branches/3_0_0/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
Tue Jun 13 00:11:49 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.myfaces.shared.renderkit.html;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.myfaces.shared.renderkit.JSFAttr;
 import org.apache.myfaces.shared.renderkit.RendererUtils;
 import org.apache.myfaces.shared.renderkit.html.HTML;
@@ -41,13 +43,13 @@
 public class HtmlTextRendererBase
         extends HtmlRenderer
 {
-    //private static final Log log = LogFactory.getLog(HtmlTextRenderer.class);
+    private static final Log log = LogFactory.getLog(HtmlTextRendererBase.class);
 
     public void encodeEnd(FacesContext facesContext, UIComponent component)
         throws IOException
     {
         org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(facesContext,component,null);
-
+        
         if (component instanceof UIInput)
         {
             renderInput(facesContext, component);
@@ -59,14 +61,16 @@
         else
         {
             throw new IllegalArgumentException("Unsupported component class " + component.getClass().getName());
-        }
+        }throw new RuntimeException("asdf");
     }
 
 
     protected static void renderOutput(FacesContext facesContext, UIComponent component)
         throws IOException
     {
+    	
         String text = org.apache.myfaces.shared.renderkit.RendererUtils.getStringValue(facesContext,
component);
+        log.info("renderOutput '" + text + "'");
         boolean escape;
         if (component instanceof HtmlOutputText || component instanceof EscapeCapable)
         {
@@ -111,6 +115,7 @@
 
             if (escape)
             {
+            	log.info("renderOutputText writing '" + text + "'");
                 writer.writeText(text, org.apache.myfaces.shared.renderkit.JSFAttr.VALUE_ATTR);
             }
             else
@@ -133,7 +138,7 @@
 
         String clientId = component.getClientId(facesContext);
         String value = org.apache.myfaces.shared.renderkit.RendererUtils.getStringValue(facesContext,
component);
-
+        log.info("renderInput '" + value + "'");
         writer.startElement(HTML.INPUT_ELEM, component);
         writer.writeAttribute(HTML.ID_ATTR, clientId, null);
         writer.writeAttribute(HTML.NAME_ATTR, clientId, null);



Mime
View raw message