1 16 17 package org.apache.webapp.admin.resources; 18 19 import java.util.List ; 20 import java.util.ArrayList ; 21 22 import javax.servlet.http.HttpServletRequest ; 23 import org.apache.struts.action.ActionError; 24 import org.apache.struts.action.ActionErrors; 25 import org.apache.struts.action.ActionForm; 26 import org.apache.struts.action.ActionMapping; 27 import org.apache.webapp.admin.LabelValueBean; 28 29 36 37 public final class MailSessionForm extends BaseForm { 38 39 40 42 43 45 46 49 private String name = null; 50 51 public String getName() { 52 return (this.name); 53 } 54 55 public void setName(String name) { 56 this.name = name; 57 } 58 59 62 private String mailhost = null; 63 64 public String getMailhost() { 65 return (this.mailhost); 66 } 67 68 public void setMailhost(String mailhost) { 69 this.mailhost = mailhost; 70 } 71 72 75 private String resourcetype = null; 76 77 80 public String getResourcetype() { 81 return this.resourcetype; 82 } 83 84 87 public void setResourcetype(String resourcetype) { 88 this.resourcetype = resourcetype; 89 } 90 91 94 private String path = null; 95 96 99 public String getPath() { 100 return this.path; 101 } 102 103 106 public void setPath(String path) { 107 this.path = path; 108 } 109 110 113 private String host = null; 114 115 118 public String getHost() { 119 return this.host; 120 } 121 122 125 public void setHost(String host) { 126 this.host = host; 127 } 128 129 130 133 private String domain = null; 134 135 138 public String getDomain() { 139 return this.domain; 140 } 141 142 145 public void setDomain(String domain) { 146 this.domain = domain; 147 } 148 149 152 private String type = null; 153 154 public String getType() { 155 return (this.type); 156 } 157 158 public void setType(String type) { 159 this.type = type; 160 } 161 162 164 170 public void reset(ActionMapping mapping, HttpServletRequest request) { 171 172 super.reset(mapping, request); 173 mailhost = null; 174 type = null; 175 } 176 177 187 188 private ActionErrors errors = null; 189 190 public ActionErrors validate(ActionMapping mapping, 191 HttpServletRequest request) { 192 193 errors = new ActionErrors(); 194 195 String submit = request.getParameter("submit"); 196 197 199 if ((mailhost == null) || (mailhost.length() < 1)) { 201 errors.add("mailhost", 202 new ActionError("resources.error.mailhost.required")); 203 } 204 206 return (errors); 207 } 208 209 } 210 | Popular Tags |