webwork/src/main/webwork/view/taglib WebWorkTagSupport.java,1.5,1.6
[email protected] Sat, 29 Jun 2002 18:36:06 -0700
| Newsgroups | gmane.comp.java.webwork.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/webwork/webwork/src/main/webwork/view/taglib
In directory usw-pr-cvs1:/tmp/cvs-serv17846
Modified Files:
WebWorkTagSupport.java
Log Message:
added support for classes that have editors with getAsText()
Index: WebWorkTagSupport.java
===================================================================
RCS file: /cvsroot/webwork/webwork/src/main/webwork/view/taglib/WebWorkTagSupport.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- WebWorkTagSupport.java 23 Jun 2002 23:54:51 -0000 1.5
+++ WebWorkTagSupport.java 30 Jun 2002 01:36:03 -0000 1.6
@@ -7,12 +7,15 @@
package webwork.view.taglib;
import webwork.util.ValueStack;
+import webwork.util.BeanUtil;
+import webwork.action.ValidationEditorSupport;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
+import java.beans.PropertyEditor;
/**
* Base class for tags.
@@ -51,10 +54,20 @@
return getStack().findValue(aName);
}
+ /**
+ * Will return the string value of the object. If the object
+ * has a ValidationEditor then its getAsText() will be called
+ * which by default calls toString() unless you override it.
+ */
protected String findString(String aName)
{
+ String result = null;
+
Object value = getStack().findValue(aName);
- return value == null ? null : value.toString();
+ if (value!=null) {
+ result = BeanUtil.toStringValue(value);
+ }
+ return result;
}
protected String toString(Throwable t)
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf