| com.methodhead.auth.LoginAction
All known Subclasses: com.methodhead.transfer.LoginAction, com.methodhead.shim.LoginAction,
LoginAction | public class LoginAction extends Action (Code) | |
Use LoginAction to build a web interface to handle logins.
This action will respond to the mappings /loginForm,
/login, and /logout, calling
LoginAction.doLoginFormdoLoginForm() ,
LoginAction.doLogin doLogin() , and
LoginAction.doLogoutdoLogout() respectively.
The following are example mappings:
The action will make use of the following message resources:
loginform.invalidlogin=Please enter a valid login and password.
loginform.missingloginpassword=Please enter a valid login and password.
|
doLogin | protected ActionForward doLogin(OperationContext op, AuthPolicy policy) throws Exception(Code) | |
The action will attempt to log in the user. An
AuthUser is instantiated and used to load and authenticate the
user. The concrete class to instantiate must be specified by the action
mapping's parameter attribute.
The user is considered authenticated if the user can be
successfully loaded and
com.methodhead.auth.AuthUser.authenticate authenticate() returns true. If the user is
successfully authenticated, the user is added to the session
using
com.methodhead.auth.AuthUtil.setUserAuthUtil.setUser() . If the desturl
parameter is available, a forward to that URL is returned,
otherwise the loggedIn forward is returned.
If the user is not successfully authenticated, the
loginform.invalidlogin action error is added to the
form and a forward to input is returned.
|
doLogout | protected ActionForward doLogout(OperationContext op, AuthPolicy policy) throws Exception(Code) | | The action will attempt to logout the user. The user is removed
from the session and the loggedOut forward is returned.
|
|
|