1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.container; 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.ActionMapping; 33 34 37 public class WebAppJettyForm extends WebAppForm { 38 39 41 private String host = null; 42 private String resourceBase = null; 43 private String displayName = null; 44 private boolean started = false; 45 46 48 54 55 public void reset(ActionMapping mapping, HttpServletRequest request) { 56 super.reset(mapping, request); 57 58 started = false; 59 } 60 61 72 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 73 ActionErrors oErrors = super.validate(mapping, request); 74 return oErrors; 75 } 76 77 89 public void numberCheck(ActionErrors p_Errors, String field, String numText, boolean rangeCheck 90 , int min, int max) { 91 if ((numText == null) || (numText.length() < 1)) { 93 p_Errors.add(field, new ActionMessage("error.webapp.setting." + field + ".required")); 94 } else { 95 96 try { 98 int num = Integer.parseInt(numText); 99 if (rangeCheck) { 101 if ((num < min) || (num > max)) { 102 p_Errors.add(field 103 , new ActionMessage("error.webapp.setting." + field + ".range")); 104 } 105 } 106 } catch (NumberFormatException e) { 107 p_Errors.add(field, new ActionMessage("error.webapp.setting." + field + ".format")); 108 } 109 } 110 } 111 112 114 public String getHost() { 115 return host; 116 } 117 118 public void setHost(String host) { 119 this.host = host; 120 } 121 122 public String getResourceBase() { 123 return resourceBase; 124 } 125 126 public void setResourceBase(String resourceBase) { 127 this.resourceBase = resourceBase; 128 } 129 130 public String getDisplayName() { 131 return displayName; 132 } 133 134 public void setDisplayName(String displayName) { 135 this.displayName = displayName; 136 } 137 138 public boolean isStarted() { 139 return started; 140 } 141 142 public void setStarted(boolean started) { 143 this.started = started; 144 } 145 } | Popular Tags |