1 4 package hero.struts.forms; 5 6 7 import javax.servlet.http.HttpServletRequest ; 8 import org.apache.struts.action.ActionError; 9 import org.apache.struts.action.ActionErrors; 10 import org.apache.struts.action.ActionForm; 11 import org.apache.struts.action.ActionMapping; 12 13 14 25 26 27 public final class EdgeForm extends ActionForm { 28 29 31 34 private String nodeIn = null; 35 36 39 private String nodeOut = null; 40 41 42 44 48 public String getNodeIn() { 49 return (nodeIn); 50 } 51 52 56 public void setNodeIn(String nodeIn) { 57 this.nodeIn = nodeIn; 58 } 59 60 64 public String getNodeOut() { 65 return (nodeOut); 66 } 67 68 72 public void setNodeOut(String nodeOut) { 73 this.nodeOut = nodeOut; 74 } 75 76 78 84 85 public void reset(ActionMapping mapping, HttpServletRequest request) { 86 this.nodeIn = null; 87 this.nodeOut = null; 88 89 } 90 91 101 public ActionErrors validate(ActionMapping mapping, 102 HttpServletRequest request) { 103 ActionErrors errors = new ActionErrors(); 104 if (nodeIn == null || nodeIn.length()==0) 105 errors.add("nodeIn", 106 new ActionError("error.nodeIn.required")); 107 if (nodeOut == null || nodeOut.length()==0) 108 errors.add("nodeOut", 109 new ActionError("error.nodeOut.required")); 110 111 return (errors); 112 } 113 114 115 116 } 117 118
| Popular Tags
|