org.telscenter.sail.webapp.presentation.web.controllers.forgotaccount.teacher
Class ForgotAccountTeacherIndexController

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by org.springframework.web.servlet.mvc.BaseCommandController
                      extended by org.springframework.web.servlet.mvc.AbstractFormController
                          extended by org.springframework.web.servlet.mvc.SimpleFormController
                              extended by org.telscenter.sail.webapp.presentation.web.controllers.forgotaccount.teacher.ForgotAccountTeacherIndexController
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

public class ForgotAccountTeacherIndexController
extends org.springframework.web.servlet.mvc.SimpleFormController

Controller for lost password teacher username and email lookup

Version:
Author:
Anthony Perritano

Field Summary
protected  JavaMailHelper javaMail
           
protected  UserService userService
           
 
Fields inherited from class org.springframework.web.servlet.mvc.BaseCommandController
DEFAULT_COMMAND_NAME
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
ForgotAccountTeacherIndexController()
           
 
Method Summary
static String generateRandomPassword()
          generate random password
 String getErrorView()
           
 JavaMailHelper getJavaMail()
          helper for sending emails
static void main(String[] args)
          Tests the password generation
protected  org.springframework.web.servlet.ModelAndView onSubmit(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object command, org.springframework.validation.BindException errors)
          gets the information by username or email and sends an email to the user with the new password.
 void setErrorView(String errorView)
           
 void setJavaMail(JavaMailHelper javaMail)
          helper for sending emails
 void setMessageSource(org.springframework.context.MessageSource messageSource)
           
 void setPortalProperties(Properties portalProperties)
           
 void setUserService(UserService userService)
          Sets the userDetailsService object.
 
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, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, 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.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
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 org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userService

protected UserService userService

javaMail

protected JavaMailHelper javaMail
Constructor Detail

ForgotAccountTeacherIndexController

public ForgotAccountTeacherIndexController()
Method Detail

getJavaMail

public JavaMailHelper getJavaMail()
helper for sending emails

Returns:

setJavaMail

public void setJavaMail(JavaMailHelper javaMail)
helper for sending emails

Parameters:
javaMail -

onSubmit

protected org.springframework.web.servlet.ModelAndView onSubmit(javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response,
                                                                Object command,
                                                                org.springframework.validation.BindException errors)
                                                         throws Exception
gets the information by username or email and sends an email to the user with the new password.

Overrides:
onSubmit in class org.springframework.web.servlet.mvc.SimpleFormController
Throws:
Exception
See Also:
SimpleFormController.onSubmit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)

setUserService

public void setUserService(UserService userService)
Sets the userDetailsService object.

Parameters:
userDetailsService -

generateRandomPassword

public static String generateRandomPassword()
generate random password

Returns:

main

public static void main(String[] args)
Tests the password generation

Parameters:
args -

getErrorView

public String getErrorView()
Returns:
the errorView

setErrorView

public void setErrorView(String errorView)
Parameters:
errorView - the errorView to set

setPortalProperties

public void setPortalProperties(Properties portalProperties)
Parameters:
portalProperties - the portalProperties to set

setMessageSource

public void setMessageSource(org.springframework.context.MessageSource messageSource)
Parameters:
messageSource - the messageSource to set


Copyright © 2012. All Rights Reserved.