Questo č il mio LoginForm.java.....come devo modificarlo?
Dimmi passo passo perchč non ho ancora le idee molto chiare....
Grazie
package spectra.Form;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
public class LoginForm extends org.apache.struts.action.ActionForm {
private String password;
private String username;
public LoginForm () {
}
//setter method
public void setPassword (String password) {
this.password = password;
}
public void setUsername (String username) {
this.username = username;
}
//getter method
public String getPassword () {
return this.password;
}
public String getUsername () {
return this.username;
}
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
{
ActionErrors errors = new ActionErrors();
if((username == null) || (username.length() < 1))
errors.add("username", new ActionError("error.username.required"));
if((password == null) || (password.length() < 1))
errors.add("password", new ActionError("error.password.required"));
return errors;
}
}