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
00027 package org.objectweb.jonas.webapp.jonasadmin.security;
00028
00029 import javax.servlet.http.HttpServletRequest;
00030
00031 import org.apache.struts.action.ActionError;
00032 import org.apache.struts.action.ActionErrors;
00033 import org.apache.struts.action.ActionForm;
00034 import org.apache.struts.action.ActionMapping;
00035
00036 public class RoleMemoryRealmForm extends ActionForm {
00037
00038
00039
00040
00041
00042 private String action = null;
00043 private String role = null;
00044 private String description = null;
00045
00046
00047
00054 public void reset(ActionMapping mapping, HttpServletRequest request) {
00055 }
00056
00067 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00068 ActionErrors oErrors = new ActionErrors();
00069
00070 if (action.equals("create") == true) {
00071 role = role.trim();
00072 if (role.length() == 0) {
00073 oErrors.add("role"
00074 , new ActionError("error.security.factory.memory.realm.role.name.required"));
00075 }
00076 }
00077 return oErrors;
00078 }
00079
00080
00081
00082 public String getRole() {
00083 return role;
00084 }
00085
00086 public void setRole(String role) {
00087 this.role = role;
00088 }
00089
00090 public String getDescription() {
00091 return description;
00092 }
00093
00094 public void setDescription(String description) {
00095 this.description = description;
00096 }
00097
00098 public String getAction() {
00099 return action;
00100 }
00101
00102 public void setAction(String action) {
00103 this.action = action;
00104 }
00105
00106 }