org.riotfamily.website.form
Class AbstractMailFormController
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.springframework.web.servlet.mvc.BaseCommandController
org.springframework.web.servlet.mvc.AbstractFormController
org.springframework.web.servlet.mvc.SimpleFormController
org.riotfamily.website.form.AbstractMailFormController
- All Implemented Interfaces:
- InitializingBean, ApplicationContextAware, ServletContextAware, Controller
public abstract class AbstractMailFormController
- extends SimpleFormController
- implements InitializingBean
Simple controller that sends data collected from a from via email.
Methods inherited from class org.springframework.web.servlet.mvc.SimpleFormController |
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, isFormChangeRequest, onFormChange, onFormChange, onSubmit, onSubmit, processFormSubmission, referenceData, referenceData, setFormView, setSuccessView, showForm, showForm, suppressValidation |
Methods inherited from class org.springframework.web.servlet.mvc.AbstractFormController |
currentFormObject, formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, handleInvalidSubmit, handleRequestInternal, isBindOnNewForm, isFormSubmission, isSessionForm, onBindOnNewForm, onBindOnNewForm, setBindOnNewForm, setSessionForm, showForm, showForm, showNewForm |
Methods inherited from class org.springframework.web.servlet.mvc.BaseCommandController |
bindAndValidate, checkCommand, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, suppressValidation, suppressValidation, useDirectFieldAccess |
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractMailFormController
public AbstractMailFormController()
createBinder
protected ServletRequestDataBinder createBinder(HttpServletRequest request,
Object command)
throws Exception
- Overrides:
createBinder
in class BaseCommandController
- Throws:
Exception
setTo
public void setTo(String to)
setBcc
public void setBcc(String[] bcc)
setFrom
public void setFrom(String from)
setSubject
public void setSubject(String subject)
setMailSender
public void setMailSender(MailSender mailSender)
setRequiredFields
public void setRequiredFields(String[] requiredFields)
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet
in interface InitializingBean
- Throws:
Exception
initBinder
protected void initBinder(HttpServletRequest request,
ServletRequestDataBinder binder)
throws Exception
- Overrides:
initBinder
in class BaseCommandController
- Throws:
Exception
onSubmit
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response,
Object command,
BindException errors)
throws Exception
- Overrides:
onSubmit
in class SimpleFormController
- Throws:
Exception
getMailText
protected abstract String getMailText(HttpServletRequest request,
Map<String,String> data)
throws Exception
- Throws:
Exception
prepareMail
protected void prepareMail(SimpleMailMessage mail,
Map<String,String> data)
- This method can be overridden in order to manipulate the mail before it
is being sent.