webwork/src/main/webwork/view/taglib TextTag.java,1.6,1.7

[email protected] Sat, 29 Jun 2002 18:35:19 -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-serv17622

Modified Files:
	TextTag.java 
Log Message:
called findString() instead of findValue().toString()

Index: TextTag.java
===================================================================
RCS file: /cvsroot/webwork/webwork/src/main/webwork/view/taglib/TextTag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- TextTag.java	30 May 2002 22:57:47 -0000	1.6
+++ TextTag.java	30 Jun 2002 01:35:17 -0000	1.7
@@ -81,17 +81,23 @@
       // Get message
       String msg = null;
       try {
-         msg = findValue("text(" + nameAttr + ")").toString();
+         msg = findString("text(" + nameAttr + ")");
+         if (msg==null) {
+            if (bodyContent != null && bodyContent.getString().trim().length() > 0) {
+               // Show tag body
+               msg = bodyContent.getString().trim();
+            } else {
+               // Show message name
+               msg = findString(nameAttr);
+            }
+         }
       } catch (Exception e) {
          if (bodyContent != null && bodyContent.getString().trim().length() > 0) {
             // Show tag body
             msg = bodyContent.getString().trim();
          } else {
             // Show message name
-            Object val = findValue(nameAttr);
-            if (val == null)
-               throw new NullPointerException("No property found for name '" + nameAttr + "'");
-            msg = val.toString();
+            msg = findString(nameAttr);
          }
       }
 




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
No, I will not fix your computer.
http://thinkgeek.com/sf