1 25 26 package org.objectweb.jonas.webapp.jonasadmin.service.container; 27 28 import java.util.List ; 29 30 import javax.servlet.http.HttpServletRequest ; 31 32 import org.apache.struts.action.ActionMessage; 33 import org.apache.struts.action.ActionErrors; 34 import org.apache.struts.action.ActionForm; 35 import org.apache.struts.action.ActionMapping; 36 import org.objectweb.jonas.webapp.jonasadmin.Jlists; 37 38 39 42 public class WebAppForm extends ActionForm { 43 44 46 private String action = "edit"; 47 private boolean save = false; 48 private String pathContext = null; 49 private String labelPathContext = null; 50 private List booleanValues = Jlists.getBooleanValues(); 51 private String objectName = null; 52 private String j2eeApplication = null; 53 private String j2eeServer = null; 54 private String name = null; 55 56 58 64 65 public void reset(ActionMapping mapping, HttpServletRequest request) { 66 action = "edit"; 67 save = false; 68 } 69 70 81 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 82 ActionErrors oErrors = new ActionErrors(); 83 if (getPathContext().length() == 0) { 85 oErrors.add("context", new ActionMessage("error.webapp.context.required")); 86 } 87 return oErrors; 88 } 89 90 92 public String getPathContext() { 93 return pathContext; 94 } 95 96 public void setPathContext(String pathContext) { 97 this.pathContext = pathContext; 98 if (pathContext.length() > 0) { 99 if (pathContext.charAt(0) != '/') { 100 this.pathContext = "/" + pathContext; 101 } 102 } 103 setLabelPathContext(WebAppItem.extractLabelPathContext(this.pathContext)); 104 } 105 106 public String getAction() { 107 return action; 108 } 109 110 public void setAction(String action) { 111 this.action = action; 112 } 113 114 public List getBooleanValues() { 115 return booleanValues; 116 } 117 118 public String getLabelPathContext() { 119 return labelPathContext; 120 } 121 122 public void setLabelPathContext(String labelPathContext) { 123 this.labelPathContext = labelPathContext; 124 } 125 126 public boolean isSave() { 127 return save; 128 } 129 130 public void setSave(boolean save) { 131 this.save = save; 132 } 133 134 public String getObjectName() { 135 return objectName; 136 } 137 138 public void setObjectName(String objectName) { 139 this.objectName = objectName; 140 } 141 142 public String getJ2eeApplication() { 143 return j2eeApplication; 144 } 145 146 public void setJ2eeApplication(String j2eeApplication) { 147 this.j2eeApplication = j2eeApplication; 148 } 149 150 public String getJ2eeServer() { 151 return j2eeServer; 152 } 153 154 public void setJ2eeServer(String j2eeServer) { 155 this.j2eeServer = j2eeServer; 156 } 157 158 public String getName() { 159 return name; 160 } 161 162 public void setName(String name) { 163 this.name = name; 164 } 165 166 } | Popular Tags |