1 26 27 package org.objectweb.jonas.webapp.jonasadmin.security; 28 29 import javax.servlet.http.HttpServletRequest ; 30 31 import org.apache.struts.action.ActionMessage; 32 import org.apache.struts.action.ActionErrors; 33 import org.apache.struts.action.ActionForm; 34 import org.apache.struts.action.ActionMapping; 35 36 public class RoleMemoryRealmForm extends ActionForm { 37 38 40 42 private String action = null; 43 private String role = null; 44 private String description = null; 45 46 48 54 public void reset(ActionMapping mapping, HttpServletRequest request) { 55 } 56 57 67 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 68 ActionErrors oErrors = new ActionErrors(); 69 if (action.equals("create") == true) { 71 role = role.trim(); 72 if (role.length() == 0) { 73 oErrors.add("role" 74 , new ActionMessage("error.security.factory.memory.realm.role.name.required")); 75 } 76 } 77 return oErrors; 78 } 79 80 82 public String getRole() { 83 return role; 84 } 85 86 public void setRole(String role) { 87 this.role = role; 88 } 89 90 public String getDescription() { 91 return description; 92 } 93 94 public void setDescription(String description) { 95 this.description = description; 96 } 97 98 public String getAction() { 99 return action; 100 } 101 102 public void setAction(String action) { 103 this.action = action; 104 } 105 106 } | Popular Tags |