org.apache.taglibs.mailer
Class MailTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--javax.servlet.jsp.tagext.BodyTagSupport
              |
              +--org.apache.taglibs.mailer.MailTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.BodyTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class MailTag
extends javax.servlet.jsp.tagext.BodyTagSupport

MailTag - JSP tag Mail is used to construct an email message. mail org.apache.taglibs.MailTag JSP Construct an email message to false false from false false cc false false bcc false false subject false false user false false password false false server false false session false false mimeMessage false false authenticate false false

Version:
1.0
Author:
Rich Catlett
See Also:
Serialized Form

Field Summary
protected static int BCC_ADDRESS
           
protected static java.lang.String BCC_ADDRESS_STRING
           
protected static int CC_ADDRESS
           
protected static java.lang.String CC_ADDRESS_STRING
           
protected static int TO_ADDRESS
          The address type int constants
protected static java.lang.String TO_ADDRESS_STRING
          The address type string constants
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
MailTag()
           
 
Method Summary
protected  void addBcc(java.lang.String value)
          add a bcc address to the list of bcc addresses for this email
protected  void addCc(java.lang.String value)
          set a cc address to the list of cc addresses for this email
protected  void addTo(java.lang.String value)
          add a to address to the list of to addresses for this email
 int doEndTag()
          implementation of method from the Tag interface that tells the JSP what to do upon encountering the end tag for this tag set
 int doStartTag()
          implementation of method from the Tag interface that tells the JSP what to do upon encountering the start tag for this tag set
 boolean getAttachments()
          get the attachments flat
 java.lang.String getBcc()
          get the bcc address/addresses for this email
 java.lang.String getBody()
          get the message for this email
 java.util.ArrayList getBodyParts()
          get the list of attachments
 java.lang.String getCc()
          get the cc address/addresses for this email
 java.lang.String getFrom()
          get the from address for this email
 java.util.ArrayList getHeaderName()
          get the list names of extra headers to be set
 java.util.ArrayList getHeaderValue()
          get the list of values of extra headers to be set
 javax.mail.internet.MimeMessage getMessage()
          get the whole email message
 java.lang.String getReplyTo()
          get the Reply-to address for this email
 javax.mail.Session getSessionObj()
          get the jndi named session to be used to find the mail session
 java.lang.String getSubject()
          get the subject for this email
 java.lang.String getTo()
          get the to address for this email
 java.lang.String getType()
          get the mime type for this email text or html
protected  void resetBcc(java.lang.String value)
          reset the bcc address to a single email address
protected  void resetCc(java.lang.String value)
          reset the cc address to a single email address
protected  void resetFrom(java.lang.String value)
          reset the from address for this email
protected  void resetReplyTo(java.lang.String value)
          reset the replyto address for this email
protected  void resetServer(java.lang.String value)
          reset the SMTP server hostname
protected  void resetSubject(java.lang.String value)
          reset the email subject
protected  void resetTo(java.lang.String value)
          reset the to address to a single email address
 void setAuthenticate(java.lang.String value)
          set authentication flag
 void setBcc(java.lang.String value)
          set the bcc address/addresses for this email
 void setBodyParts(javax.mail.internet.MimeBodyPart mbp)
          set attachments into an arraylist
 void setCc(java.lang.String value)
          set the cc address/addresses for this email
 void setError(boolean value)
          set true if error has occured
 void setFrom(java.lang.String value)
          set the from address for this email
protected  void setHeader(java.lang.String name, java.lang.String value)
          set the name and value of any extra headers to be sent
 void setMessage(java.lang.String value)
          set the message for this email
 void setMimeMessage(java.lang.String value)
          set the jndi named session to be used to find the mail session
 void setPassword(java.lang.String value)
          set the password for basic smtp authentication
 void setReplyTo(java.lang.String value)
          set the Reply-to address for this email
 void setServer(java.lang.String value)
          set the server to be used to find the mail session if one is not provided
 void setSession(java.lang.String value)
          set the jndi named session to be used to find the mail session
 void setSubject(java.lang.String value)
          set the subject for this email
 void setTo(java.lang.String value)
          set the to address for this email
 void setType(java.lang.String value)
          set the mime type for this email text or html
 void setUser(java.lang.String value)
          set the login user name for basic smtp authentication
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

TO_ADDRESS_STRING

protected static final java.lang.String TO_ADDRESS_STRING
The address type string constants

CC_ADDRESS_STRING

protected static final java.lang.String CC_ADDRESS_STRING

BCC_ADDRESS_STRING

protected static final java.lang.String BCC_ADDRESS_STRING

TO_ADDRESS

protected static final int TO_ADDRESS
The address type int constants

CC_ADDRESS

protected static final int CC_ADDRESS

BCC_ADDRESS

protected static final int BCC_ADDRESS
Constructor Detail

MailTag

public MailTag()
Method Detail

doStartTag

public final int doStartTag()
                     throws javax.servlet.jsp.JspException
implementation of method from the Tag interface that tells the JSP what to do upon encountering the start tag for this tag set
Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
EVAL_BODY_TAG - integer value telling the JSP engine to evaluate the body of this tag
Throws:
javax.servlet.jsp.JspException - thrown when error occurs in processing the body of this method

doEndTag

public final int doEndTag()
                   throws javax.servlet.jsp.JspException
implementation of method from the Tag interface that tells the JSP what to do upon encountering the end tag for this tag set
Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
Returns:
- integer value telling the JSP engine whether or not to evaluate the body of this tag
Throws:
javax.servlet.jsp.JspException - thrown when error occurs in processing the body of this method

getMessage

public final javax.mail.internet.MimeMessage getMessage()
                                                 throws javax.servlet.jsp.JspException
get the whole email message
Returns:
message - the entire email message

getBodyParts

public final java.util.ArrayList getBodyParts()
get the list of attachments
Returns:
- an arraylist of the mimebodyparts for attachments

getAttachments

public final boolean getAttachments()
get the attachments flat
Returns:
- the flag that lets the message know if there are attachments

getTo

public final java.lang.String getTo()
get the to address for this email
Returns:
- the address to whom this mail is to be sent

getReplyTo

public final java.lang.String getReplyTo()
get the Reply-to address for this email
Returns:
- the address to whom this mail is to be sent

getFrom

public final java.lang.String getFrom()
get the from address for this email
Returns:
- the address from whom this mail is to be sent

getCc

public final java.lang.String getCc()
get the cc address/addresses for this email
Returns:
- list of carbon copy addresses to recieve this email

getBcc

public final java.lang.String getBcc()
get the bcc address/addresses for this email
Returns:
- list of blind carbon copy addresses to recieve this email

getSubject

public final java.lang.String getSubject()
get the subject for this email
Returns:
- string that is the subject of this email

getHeaderName

public final java.util.ArrayList getHeaderName()
get the list names of extra headers to be set
Returns:
- list of names of extra headers to be set

getHeaderValue

public final java.util.ArrayList getHeaderValue()
get the list of values of extra headers to be set
Returns:
- list of values of extra headers to be set

getBody

public final java.lang.String getBody()
get the message for this email
Returns:
- string that is the body of this email

getSessionObj

public final javax.mail.Session getSessionObj()
get the jndi named session to be used to find the mail session
Returns:
- session object for this email

getType

public final java.lang.String getType()
get the mime type for this email text or html
Returns:
- string that is the mime type for this email

setError

public final void setError(boolean value)
set true if error has occured
Parameters:
value - value that determines if an error has occured

setTo

public final void setTo(java.lang.String value)
set the to address for this email
Parameters:
value - string that is the address to whom this mail is to be sent

setReplyTo

public final void setReplyTo(java.lang.String value)
set the Reply-to address for this email
Parameters:
value - string that is the address to whom this mail is to be sent

setFrom

public final void setFrom(java.lang.String value)
set the from address for this email
Parameters:
value - string that is the address from whom this mail is to be sent

setCc

public final void setCc(java.lang.String value)
set the cc address/addresses for this email
Parameters:
value - string that is the list of carbon copy addresses to recieve this email

setBcc

public final void setBcc(java.lang.String value)
set the bcc address/addresses for this email
Parameters:
value - string that is the list of blind carbon copy addresses to recieve this email

setSubject

public final void setSubject(java.lang.String value)
set the subject for this email
Parameters:
value - string that is the subject of this email

setHeader

protected final void setHeader(java.lang.String name,
                               java.lang.String value)
set the name and value of any extra headers to be sent
Parameters:
name - string that is the name of an extra header to be sent
value - string that is the value of an extra header to be sent

setMessage

public final void setMessage(java.lang.String value)
set the message for this email
Parameters:
value - string that is the subject of this email

setBodyParts

public final void setBodyParts(javax.mail.internet.MimeBodyPart mbp)
set attachments into an arraylist
Parameters:
mbp - mimebodypart to be attached to the e-mail

setUser

public final void setUser(java.lang.String value)
set the login user name for basic smtp authentication
Parameters:
value - login name

setPassword

public final void setPassword(java.lang.String value)
set the password for basic smtp authentication
Parameters:
value - Plain text password for authentication

setServer

public final void setServer(java.lang.String value)
set the server to be used to find the mail session if one is not provided
Parameters:
value - string that is the server used to find the mail session

setMimeMessage

public final void setMimeMessage(java.lang.String value)
set the jndi named session to be used to find the mail session
Parameters:
value - string that is the jndi named session

setSession

public final void setSession(java.lang.String value)
set the jndi named session to be used to find the mail session
Parameters:
value - string that is the jndi named session

setAuthenticate

public final void setAuthenticate(java.lang.String value)
set authentication flag
Parameters:
value - boolean value that marks if an authenticator object should be used in the creation of the session so that user authentication can be performed

setType

public final void setType(java.lang.String value)
set the mime type for this email text or html
Parameters:
value - string that is the mime type for this email

addTo

protected final void addTo(java.lang.String value)
add a to address to the list of to addresses for this email
Parameters:
value - string that is an address to whom this mail is to be sent

addCc

protected final void addCc(java.lang.String value)
set a cc address to the list of cc addresses for this email
Parameters:
value - string that is a cc address to be added to the list of cc addresses for this email

addBcc

protected final void addBcc(java.lang.String value)
add a bcc address to the list of bcc addresses for this email
Parameters:
value - string that is a bcc address to be added to the list of bcc addresses for this email

resetTo

protected final void resetTo(java.lang.String value)
reset the to address to a single email address
Parameters:
value - string that is an address to whom this mail is to be sent

resetCc

protected final void resetCc(java.lang.String value)
reset the cc address to a single email address
Parameters:
value - string that is a cc address to be used for this email

resetBcc

protected final void resetBcc(java.lang.String value)
reset the bcc address to a single email address
Parameters:
value - string that is a bcc address to be used for this email

resetFrom

protected final void resetFrom(java.lang.String value)
reset the from address for this email
Parameters:
value - string that is the address from whom this mail is to be sent

resetReplyTo

protected final void resetReplyTo(java.lang.String value)
reset the replyto address for this email
Parameters:
value - string that is the address for email reply to

resetSubject

protected final void resetSubject(java.lang.String value)
reset the email subject
Parameters:
value - string that is the email subject

resetServer

protected final void resetServer(java.lang.String value)
reset the SMTP server hostname
Parameters:
value - string that is SMTP server hostname


Copyright ? 2000 Apache Software Foundation. All Rights Reserved.