1 25 26 package org.objectweb.jonas.webapp.jonasadmin.joramplatform; 27 28 import javax.servlet.http.HttpServletRequest ; 29 30 import org.apache.struts.action.ActionMessage; 31 import org.apache.struts.action.ActionErrors; 32 import org.apache.struts.action.ActionForm; 33 import org.apache.struts.action.ActionMapping; 34 35 38 public class JoramDestinationForm extends ActionForm { 39 40 42 44 private String name = null; 45 private String type = null; 46 47 49 55 56 public void reset(ActionMapping mapping, HttpServletRequest request) { 57 name = null; 58 type = null; 59 } 60 61 72 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 73 ActionErrors oErrors = new ActionErrors(); 74 if ((getName() == null) || (getName().length() == 0)) { 75 oErrors.add("name", new ActionMessage("error.resource.jms.create.name.required")); 76 } 77 if (getType() == null) { 78 oErrors.add("type", new ActionMessage("error.resource.jms.create.type.required")); 79 } 80 return oErrors; 81 } 82 83 85 public String getName() { 86 return name; 87 } 88 89 public void setName(String name) { 90 this.name = name; 91 } 92 93 public String getType() { 94 return type; 95 } 96 97 public void setType(String type) { 98 this.type = type; 99 } 100 101 } 102 | Popular Tags |