| 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 ResourceLinkForm 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 global = null; 63 64 public String getGlobal() { 65 return (this.global); 66 } 67 68 public void setGlobal(String global) { 69 this.global = global; 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 name = null; 174 global = null; 175 type = null; 176 } 177 178 188 189 private ActionErrors errors = null; 190 191 public ActionErrors validate(ActionMapping mapping, 192 HttpServletRequest request) { 193 errors = new ActionErrors(); 194 195 String submit = request.getParameter("submit"); 196 197 199 if ((name == null) || (name.length() < 1)) { 201 errors.add("name", 202 new ActionError("resources.error.name.required")); 203 } 204 205 if (( global == null) || (global.length() < 1)) { 207 errors.add("global", 208 new ActionError("resources.error.global.required")); 209 } 210 211 if ((type == null) || (type.length() < 1)) { 213 errors.add("type", 214 new ActionError("resources.error.type.required")); 215 } 216 217 219 return (errors); 220 221 } 222 223 224 } 225 | Popular Tags |