DestinationForm.java

00001 
00026 package org.objectweb.jonas.webapp.jonasadmin.resource;
00027 
00028 import javax.servlet.http.HttpServletRequest;
00029 
00030 import org.apache.struts.action.ActionError;
00031 import org.apache.struts.action.ActionErrors;
00032 import org.apache.struts.action.ActionForm;
00033 import org.apache.struts.action.ActionMapping;
00034 
00038 public class DestinationForm extends ActionForm {
00039 
00040 // --------------------------------------------------------- Constants
00041 
00042 // --------------------------------------------------------- Properties variables
00043 
00044     private String name = null;
00045     private String type = null;
00046 
00047 // --------------------------------------------------------- Public Methods
00048 
00056     public void reset(ActionMapping mapping, HttpServletRequest request) {
00057         name = null;
00058         type = null;
00059     }
00060 
00072     public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00073         ActionErrors oErrors = new ActionErrors();
00074         if ((getName() == null) || (getName().length() == 0)) {
00075             oErrors.add("name", new ActionError("error.resource.jms.create.name.required"));
00076         }
00077         if (getType() == null) {
00078             oErrors.add("type", new ActionError("error.resource.jms.create.type.required"));    
00079         }
00080         return oErrors;
00081     }
00082 
00083     // --------------------------------------------------------- Properties Methods
00084 
00085     public String getName() {
00086         return name;
00087     }
00088 
00089     public void setName(String name) {
00090         this.name = name;
00091     }
00092 
00093     public String getType() {
00094         return type;
00095     }
00096 
00097     public void setType(String type) {
00098         this.type = type;
00099     }
00100 
00101 }

Generated on Tue Feb 15 15:05:29 2005 for JOnAS by  doxygen 1.3.9.1