com.ora.jsp.servlets
Class AuthenticateAction
java.lang.Object
org.apache.struts.action.Action
com.ora.jsp.servlets.AuthenticateAction
- public class AuthenticateAction
- extends org.apache.struts.action.Action
This class performs authentication in the Project Billboard
application.
- Version:
- 2.0
- Author:
- Hans Bergsten, Gefion software
Fields inherited from class org.apache.struts.action.Action |
DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGES_KEY, MULTIPART_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY |
Method Summary |
org.apache.struts.action.ActionForward |
perform(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Autheticates a user with help from the EmployeeRegistryBean,
using the "userName" and "password" request parameters. |
private void |
setLoginCookies(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String userName,
java.lang.String password)
Set or "delete" the login cookies, depending on the value of the
"remember" parameter. |
Methods inherited from class org.apache.struts.action.Action |
generateToken, getLocale, getResources, getServlet, isCancelled, isTokenValid, perform, perform, perform, resetToken, saveErrors, saveToken, setLocale, setServlet, toHex |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuthenticateAction
public AuthenticateAction()
perform
public org.apache.struts.action.ActionForward perform(org.apache.struts.action.ActionMapping mapping,
org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
- Autheticates a user with help from the EmployeeRegistryBean,
using the "userName" and "password" request parameters.
If the user can be authenticated, the "validUser" session
attribute is set to an instance of the EmployeeBean, to
serve as an authentication token in this application.
Cookies with the user name and password are set or reset
as specified by the "remember" request parameter.
- Parameters:
mapping
- The ActionMapping used to select this instanceform
- The optional ActionForm bean for this request (if any)request
- The HTTP request we are processingresponse
- The HTTP response we are creating
- Throws:
java.io.IOException
- if an input/output error occurs
javax.servlet.ServletException
- if a servlet exception occurs
setLoginCookies
private void setLoginCookies(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String userName,
java.lang.String password)
- Set or "delete" the login cookies, depending on the value of the
"remember" parameter.