info.aduna.gee.publication.servlets
Class MailFormServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by info.aduna.gee.publication.servlets.MailFormServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class MailFormServlet
extends javax.servlet.http.HttpServlet

Servlet used to enable the emailing of form contents. The form should/can contain a number of special fields (hidden or otherwise) which will be used in the construction of the email message: to Address(es) of the recipient(s). REQUIRED cc Address(es) of the carbon copy recipient(s) bcc Address(es) of the blind carbon copy recipient(s) from Address of the sender. If this field is not available, the default sender is used, as specified by MAIL_FROM_ADDRESS in zpad.conf. subject The subject of the message nextpage The URL to redirect to when the mail has been sent. REQUIRED mailtemplate A file to use as a template for the email to send. If this field is unavailable, the email will contain just a list of fieldnames and their values. If the mailtemplate starts with , it is assumed to be in HTML format and sent as such (i.e. Content-Type="text/html"). Otherwise, the email is sent as plain text. All fields other than the ones mention above will be either listed in alphabetical order (if no mailtemplate was specified), or replaced in the template, where they should appear as uppercase fieldname surrounded by double underscores. E.g. if the fieldname is "name", the pattern to substitute is "__NAME__". The names of the recipients are checked against MAIL_FORM_DESTINATIONS to protect against unwanted relaying.

See Also:
Serialized Form

Constructor Summary
MailFormServlet()
           
 
Method Summary
protected  void addRecipients(javax.mail.Message msg, String addresses, javax.mail.Message.RecipientType type, String allowedDestinations)
           
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 String getServletInfo()
           
 String toString()
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailFormServlet

public MailFormServlet()
Method Detail

getServletInfo

public String getServletInfo()
Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

addRecipients

protected void addRecipients(javax.mail.Message msg,
                             String addresses,
                             javax.mail.Message.RecipientType type,
                             String allowedDestinations)
                      throws javax.mail.internet.AddressException,
                             javax.mail.MessagingException
Throws:
javax.mail.internet.AddressException
javax.mail.MessagingException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1997-2008 Aduna. All Rights Reserved.