com.pow2.struts.forms
Class LoginForm

java.lang.Object
  extended byorg.apache.struts.action.ActionForm
      extended bycom.pow2.struts.forms.LoginForm
All Implemented Interfaces:
Serializable

public class LoginForm
extends org.apache.struts.action.ActionForm

Login form class.
Wrap the login and password values retrieved from the login form and Validate these fields against null or blank strings.

Author:
Luca Fossato
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
LoginForm()
          Default constructor.
 
Method Summary
 void clear()
          Clear the form login and passwd attributes
 String getLogin()
          Get the login value.
 String getPasswd()
          Get the password value.
 void setLogin(String v)
          Set the new login value.
 void setPasswd(String v)
          Set the new password value.
 org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, HttpServletRequest request)
          Validate login and password fields.
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginForm

public LoginForm()
Default constructor.
Set login and password to blank strings.

Method Detail

getLogin

public String getLogin()
Get the login value.

Returns:
The login value

getPasswd

public String getPasswd()
Get the password value.

Returns:
The passwd value

setLogin

public void setLogin(String v)
Set the new login value.

Parameters:
v - The new login value.

setPasswd

public void setPasswd(String v)
Set the new password value.

Parameters:
v - The new password value

validate

public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
                                                      HttpServletRequest request)
Validate login and password fields.
These fields cannot be null or empty.
If the validation process finds problems, it returns an ActionErrors instance containing ActionError's, which are classes that contain the error message keys (into the application's MessageResources bundle) that should be displayed.
The controller servlet will store this array as a request attribute suitable for use by the tag, and will forward control back to the input form (identified by the input property for this ActionMapping).

Parameters:
mapping - the ActionMapping object.
request - the HttpServletRequest object.
Returns:
a collection of errors.

clear

public void clear()
Clear the form login and passwd attributes



Copyright © 2002-2004 Power Of Two S.R.L. All Rights Reserved.