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 WebAppCatalinaForm extends WebAppForm { 38 39 41 private String host = null; 42 private boolean cookies = false; 43 private boolean reloadable = false; 44 private boolean swallowOutput = false; 45 private boolean crossContext = false; 46 private boolean override = false; 47 private String docBase = null; 48 private int state = 0; 49 50 52 58 59 public void reset(ActionMapping mapping, HttpServletRequest request) { 60 super.reset(mapping, request); 61 62 cookies = true; 63 reloadable = false; 64 swallowOutput = false; 65 crossContext = false; 66 override = false; 67 } 68 69 80 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 81 ActionErrors oErrors = super.validate(mapping, request); 82 return oErrors; 84 } 85 86 98 public void numberCheck(ActionErrors p_Errors, String field, String numText, boolean rangeCheck 99 , int min, int max) { 100 if ((numText == null) || (numText.length() < 1)) { 102 p_Errors.add(field, new ActionMessage("error.webapp.setting." + field + ".required")); 103 } else { 104 105 try { 107 int num = Integer.parseInt(numText); 108 if (rangeCheck) { 110 if ((num < min) || (num > max)) { 111 p_Errors.add(field 112 , new ActionMessage("error.webapp.setting." + field + ".range")); 113 } 114 } 115 } catch (NumberFormatException e) { 116 p_Errors.add(field, new ActionMessage("error.webapp.setting." + field + ".format")); 117 } 118 } 119 } 120 121 131 public boolean isCookies() { 132 return cookies; 133 } 134 135 public void setCookies(boolean cookies) { 136 this.cookies = cookies; 137 } 138 139 public boolean isReloadable() { 140 return reloadable; 141 } 142 143 public void setReloadable(boolean reloadable) { 144 this.reloadable = reloadable; 145 } 146 147 public boolean isSwallowOutput() { 148 return swallowOutput; 149 } 150 151 public void setSwallowOutput(boolean swallowOutput) { 152 this.swallowOutput = swallowOutput; 153 } 154 155 public String getHost() { 156 return host; 157 } 158 159 public void setHost(String host) { 160 this.host = host; 161 } 162 163 public boolean isCrossContext() { 164 return crossContext; 165 } 166 167 public void setCrossContext(boolean crossContext) { 168 this.crossContext = crossContext; 169 } 170 171 public String getDocBase() { 172 return docBase; 173 } 174 175 public void setDocBase(String docBase) { 176 this.docBase = docBase; 177 } 178 179 public boolean isOverride() { 180 return override; 181 } 182 183 public void setOverride(boolean override) { 184 this.override = override; 185 } 186 public int getState() { 187 return state; 188 } 189 190 public void setState(int state) { 191 this.state = state; 192 } 193 194 195 } | Popular Tags |