00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 package org.objectweb.jonas.webapp.jonasadmin.service.container;
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.ActionMapping;
00033
00037 public class WebAppJettyForm extends WebAppForm {
00038
00039
00040
00041 private String host = null;
00042 private String resourceBase = null;
00043 private String displayName = null;
00044 private boolean started = false;
00045
00046
00047
00055 public void reset(ActionMapping mapping, HttpServletRequest request) {
00056 super.reset(mapping, request);
00057
00058 started = false;
00059 }
00060
00072 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00073 ActionErrors oErrors = super.validate(mapping, request);
00074 return oErrors;
00075 }
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 public void numberCheck(ActionErrors p_Errors, String field, String numText, boolean rangeCheck
00090 , int min, int max) {
00091
00092 if ((numText == null) || (numText.length() < 1)) {
00093 p_Errors.add(field, new ActionError("error.webapp.setting." + field + ".required"));
00094 }
00095 else {
00096
00097
00098 try {
00099 int num = Integer.parseInt(numText);
00100
00101 if (rangeCheck) {
00102 if ((num < min) || (num > max)) {
00103 p_Errors.add(field
00104 , new ActionError("error.webapp.setting." + field + ".range"));
00105 }
00106 }
00107 }
00108 catch (NumberFormatException e) {
00109 p_Errors.add(field, new ActionError("error.webapp.setting." + field + ".format"));
00110 }
00111 }
00112 }
00113
00114
00115
00116 public String getHost() {
00117 return host;
00118 }
00119
00120 public void setHost(String host) {
00121 this.host = host;
00122 }
00123
00124 public String getResourceBase() {
00125 return resourceBase;
00126 }
00127
00128 public void setResourceBase(String resourceBase) {
00129 this.resourceBase = resourceBase;
00130 }
00131
00132 public String getDisplayName() {
00133 return displayName;
00134 }
00135
00136 public void setDisplayName(String displayName) {
00137 this.displayName = displayName;
00138 }
00139
00140 public boolean isStarted() {
00141 return started;
00142 }
00143
00144 public void setStarted(boolean started) {
00145 this.started = started;
00146 }
00147 }