org.apache.taglibs.mailer
Class MailTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.taglibs.mailer.MailTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, 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 port 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_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
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 getCharset()
          get the character set 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 resetPort(java.lang.String value)
          reset the SMTP server port
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 setCharset(java.lang.String value)
          set the character set 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 setPort(java.lang.String value)
          set the server port to be used for the mail session
 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

See Also:
Constant Field Values

CC_ADDRESS_STRING

protected static final java.lang.String CC_ADDRESS_STRING
See Also:
Constant Field Values

BCC_ADDRESS_STRING

protected static final java.lang.String BCC_ADDRESS_STRING
See Also:
Constant Field Values

TO_ADDRESS

protected static final int TO_ADDRESS
The address type int constants

See Also:
Constant Field Values

CC_ADDRESS

protected static final int CC_ADDRESS
See Also:
Constant Field Values

BCC_ADDRESS

protected static final int BCC_ADDRESS
See Also:
Constant Field Values
Constructor Detail

MailTag

public MailTag()
Method Detail

doStartTag

public 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

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
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 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

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
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 javax.mail.internet.MimeMessage getMessage()
                                           throws javax.servlet.jsp.JspException
get the whole email message

Returns:
message - the entire email message
Throws:
javax.servlet.jsp.JspException

getBodyParts

public java.util.ArrayList getBodyParts()
get the list of attachments

Returns:
- an arraylist of the mimebodyparts for attachments

getAttachments

public boolean getAttachments()
get the attachments flat

Returns:
- the flag that lets the message know if there are attachments

getTo

public java.lang.String getTo()
get the to address for this email

Returns:
- the address to whom this mail is to be sent

getReplyTo

public 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 java.lang.String getFrom()
get the from address for this email

Returns:
- the address from whom this mail is to be sent

getCc

public java.lang.String getCc()
get the cc address/addresses for this email

Returns:
- list of carbon copy addresses to recieve this email

getBcc

public 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 java.lang.String getSubject()
get the subject for this email

Returns:
- string that is the subject of this email

getHeaderName

public 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 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 java.lang.String getBody()
get the message for this email

Returns:
- string that is the body of this email

getSessionObj

public 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 java.lang.String getType()
get the mime type for this email text or html

Returns:
- string that is the mime type for this email

getCharset

public java.lang.String getCharset()
get the character set for this email

Returns:
- string that is the character set for this email

setError

public void setError(boolean value)
set true if error has occured

Parameters:
value - value that determines if an error has occured

setTo

public 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 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 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 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 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 void setSubject(java.lang.String value)
set the subject for this email

Parameters:
value - string that is the subject of this email

setHeader

protected 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 void setMessage(java.lang.String value)
set the message for this email

Parameters:
value - string that is the subject of this email

setBodyParts

public void setBodyParts(javax.mail.internet.MimeBodyPart mbp)
set attachments into an arraylist

Parameters:
mbp - mimebodypart to be attached to the e-mail

setUser

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

Parameters:
value - login name

setPassword

public void setPassword(java.lang.String value)
set the password for basic smtp authentication

Parameters:
value - Plain text password for authentication

setServer

public 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

setPort

public void setPort(java.lang.String value)
set the server port to be used for the mail session

Parameters:
value - string that is the server port to be used

setMimeMessage

public 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 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 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 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

setCharset

public void setCharset(java.lang.String value)
set the character set for this email

Parameters:
value - string that is the character set for this email

addTo

protected 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 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 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 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 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 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 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 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 void resetSubject(java.lang.String value)
reset the email subject

Parameters:
value - string that is the email subject

resetServer

protected void resetServer(java.lang.String value)
reset the SMTP server hostname

Parameters:
value - string that is SMTP server hostname

resetPort

protected void resetPort(java.lang.String value)
reset the SMTP server port

Parameters:
value - string that is SMTP server port


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.