You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@apache.org on 2001/06/01 19:11:47 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html ButtonTag.java

craigmcc    01/06/01 10:11:47

  Modified:    src/share/org/apache/struts/taglib/html Tag:
                        STRUTS_1_0_BRANCH ButtonTag.java
  Log:
  Restore the ability of the <html:button> tag to grab it's text from the
  nested body content (typically an internationalized message).
  
  Thanks to Hal Deadman (as always :-) for the patch.
  
  PR: Bugzilla #1890
  Submitted by:	Thane Eisener <th...@nortelnetworks.com>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +20 -4     jakarta-struts/src/share/org/apache/struts/taglib/html/ButtonTag.java
  
  Index: ButtonTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ButtonTag.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- ButtonTag.java	2001/04/18 01:31:14	1.3
  +++ ButtonTag.java	2001/06/01 17:11:45	1.3.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ButtonTag.java,v 1.3 2001/04/18 01:31:14 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/04/18 01:31:14 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/html/ButtonTag.java,v 1.3.2.1 2001/06/01 17:11:45 craigmcc Exp $
  + * $Revision: 1.3.2.1 $
  + * $Date: 2001/06/01 17:11:45 $
    *
    * ====================================================================
    *
  @@ -74,7 +74,7 @@
    * Renders an HTML BUTTON tag within the Struts framework.
    *
    * @author Don Clasen
  - * @version $Revision: 1.3 $ $Date: 2001/04/18 01:31:14 $
  + * @version $Revision: 1.3.2.1 $ $Date: 2001/06/01 17:11:45 $
    */
   
   public class ButtonTag extends BaseHandlerTag {
  @@ -152,6 +152,22 @@
   
       }
       
  +
  +    /**
  +     * Save the associated label from the body content (if any).
  +     * @exception JspException if a JSP exception has occurred
  +     */
  +    public int doAfterBody() throws JspException {
  +
  +        if (bodyContent != null) {
  +            String value = bodyContent.getString().trim();
  +            if (value.length() > 0)
  +                text = value;
  +        }
  +        return (SKIP_BODY);
  +
  +    }
  +
   
       /**
        * Process the end of this tag.