/sun/src/ak/webcontrol/core/form/MailAliasDestBean.java |
---|
0,0 → 1,53 |
package ak.webcontrol.core.form; |
import ak.webcontrol.util.StringConverter; |
import ak.webcontrol.core.model.MailAliasDestination; |
public final class MailAliasDestBean |
{ |
private String id; |
private String mailbox; |
private String email; |
public MailAliasDestBean() |
{ |
} |
public MailAliasDestBean(MailAliasDestination dest) |
{ |
this.id = StringConverter.toString(dest.getId()); |
this.mailbox = (dest.getMailbox() == null) |
? null : StringConverter.toString(dest.getMailbox().getId()); |
this.email = dest.getEmail(); |
} |
public String getId() |
{ |
return id; |
} |
public void setId(String id) |
{ |
this.id = id; |
} |
public String getMailbox() |
{ |
return mailbox; |
} |
public void setMailbox(String mailbox) |
{ |
this.mailbox = mailbox; |
} |
public String getEmail() |
{ |
return email; |
} |
public void setEmail(String email) |
{ |
this.email = email; |
} |
} |
/sun/src/ak/webcontrol/core/form/UserPasswordForm.java |
---|
0,0 → 1,30 |
package ak.webcontrol.core.form; |
import javax.servlet.http.HttpServletRequest; |
import org.apache.struts.action.ActionError; |
import org.apache.struts.action.ActionErrors; |
import org.apache.struts.action.ActionForm; |
import org.apache.struts.action.ActionMapping; |
import ak.webcontrol.core.CoreResources; |
public final class UserPasswordForm |
extends org.apache.struts.validator.DynaValidatorForm |
{ |
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) |
{ |
ActionErrors errors = super.validate(mapping, request); |
if(errors == null || errors.size() == 0) { // if no errors in simple checks |
String password = (String)get("password"); |
String password2 = (String)get("password2"); |
if(!password.equals(password2)) { |
if(errors == null) errors = new ActionErrors(); |
errors.add("password", new ActionError(CoreResources.PASSWORDS_DONT_MATCH)); |
} |
} |
return errors; |
} |
} |