catlett     01/05/21 11:19:19

  Modified:    mailer/src/org/apache/taglibs/mailer MessageTag.java
  Log:
  attribute type added
  
  Revision  Changes    Path
  1.2       +26 -5     
jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/MessageTag.java
  
  Index: MessageTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/MessageTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MessageTag.java   2001/03/31 03:10:36     1.1
  +++ MessageTag.java   2001/05/21 18:19:14     1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/MessageTag.java,v 1.1 
2001/03/31 03:10:36 glenn Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/03/31 03:10:36 $
  + * $Header: 
/home/cvs/jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/MessageTag.java,v 1.2 
2001/05/21 18:19:14 catlett Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/05/21 18:19:14 $
    *
    * ====================================================================
    *
  @@ -66,13 +66,19 @@
   import javax.servlet.jsp.tagext.*;
   
   /**
  - * ToTag - JSP tag <b>Message</b> is used to set the message in an email.
  + * MessageTag - JSP tag <b>Message</b> is used to set the message in an email.
    *
    * <tag>
  - *        <name>message</name>
  - *     <tagclass>net.more.jsp.tags.mail.MessageTag</tagclass>
  - *     <bodycontent>JSP</bodycontent>
  - *     <info>Set the Message of the email</info>
  + *      <name>message</name>
  + *      <tagclass>net.more.jsp.tags.mail.MessageTag</tagclass>
  + *      <bodycontent>JSP</bodycontent>
  + *      <info>Set the Message of the email</info>
  + *
  + *      <attribute>
  + *            <name>type</name>
  + *            <required>false</required>
  + *            <rtexprvalue>false</rtexprvalue>
  + *      </attribute>
    * </tag>
    *
    * @author Rich Catlett
  @@ -83,6 +89,10 @@
   
   public class MessageTag extends BodyTagSupport {
   
  +    /**
  +     * can be "text" or "html" (otherwise text is default)
  +     */
  +    private String type = "text";
   
       /**
        *  implementation of the method from the tag interface that tells the JSP
  @@ -106,9 +116,20 @@
           else {
            if ((body = bodyContent.getString()) != null) {
                myparent.setMessage(body); // set message in the parent tag
  +             myparent.setType(type);  // set the mime type of the message
            } else
                throw new JspException("The message tag is empty");
        }
        return SKIP_BODY;
  +    }
  +
  +    /**
  +     * set the mime type for this email text or html
  +     *
  +     * @param value  string that is the mime type for this email
  +     *
  +     */
  +    public final void setType(String value) {
  +     type = value;
       }
   }
  
  
  

Reply via email to