1 16 17 18 package org.apache.webapp.admin.host; 19 20 import javax.servlet.http.HttpServletRequest ; 21 import org.apache.struts.action.ActionError; 22 import org.apache.struts.action.ActionErrors; 23 import org.apache.struts.action.ActionForm; 24 import org.apache.struts.action.ActionMapping; 25 import java.util.List ; 26 27 33 34 public final class AliasForm extends ActionForm { 35 36 38 41 private String hostName = null; 42 43 46 private String aliasName = null; 47 48 51 private List aliasVals = null; 52 53 55 58 public String getHostName() { 59 60 return this.hostName; 61 62 } 63 64 67 public void setHostName(String hostName) { 68 69 this.hostName = hostName; 70 71 } 72 73 76 public String getAliasName() { 77 78 return this.aliasName; 79 80 } 81 82 85 public void setAliasName(String aliasName) { 86 87 this.aliasName = aliasName; 88 89 } 90 91 94 public List getAliasVals() { 95 96 return this.aliasVals; 97 98 } 99 100 103 public void setAliasVals(List aliasVals) { 104 105 this.aliasVals = aliasVals; 106 107 } 108 109 111 117 public void reset(ActionMapping mapping, HttpServletRequest request) { 118 119 this.aliasName = null; 120 this.hostName = null; 121 122 } 123 124 127 public String toString() { 128 129 StringBuffer sb = new StringBuffer ("AliasForm[hostName="); 130 sb.append(hostName); 131 sb.append("]"); 132 return (sb.toString()); 133 134 } 135 136 146 147 public ActionErrors validate(ActionMapping mapping, 148 HttpServletRequest request) { 149 150 ActionErrors errors = new ActionErrors(); 151 152 String submit = request.getParameter("submit"); 153 154 157 if ((aliasName== null) || (aliasName.length() < 1)) { 159 errors.add("aliasName", new ActionError("error.aliasName.required")); 160 } 161 162 return errors; 164 } 165 166 } 167 | Popular Tags |