1 16 17 package org.apache.webapp.admin.realm; 18 19 import javax.servlet.http.HttpServletRequest ; 20 import org.apache.struts.action.ActionError; 21 import org.apache.struts.action.ActionErrors; 22 import org.apache.struts.action.ActionForm; 23 import org.apache.struts.action.ActionMapping; 24 import java.util.List ; 25 import java.util.Enumeration ; 26 27 import org.apache.webapp.admin.ApplicationServlet; 28 import org.apache.webapp.admin.LabelValueBean; 29 30 36 37 public final class MemoryRealmForm extends RealmForm { 38 39 41 44 private String pathName = null; 45 46 48 51 public String getPathName() { 52 53 return this.pathName; 54 55 } 56 57 60 public void setPathName(String pathName) { 61 62 this.pathName = pathName; 63 64 } 65 66 68 74 public void reset(ActionMapping mapping, HttpServletRequest request) { 75 76 super.reset(mapping, request); 77 this.pathName = null; 78 79 } 80 81 84 public String toString() { 85 86 StringBuffer sb = new StringBuffer ("UserDatabaseRealmForm[adminAction="); 87 sb.append(getAdminAction()); 88 sb.append(",pathname="); 89 sb.append(pathName); 90 sb.append("',objectName='"); 91 sb.append(getObjectName()); 92 sb.append("',realmType="); 93 sb.append(getRealmType()); 94 sb.append("]"); 95 return (sb.toString()); 96 97 } 98 99 109 110 public ActionErrors validate(ActionMapping mapping, 111 HttpServletRequest request) { 112 113 ActionErrors errors = new ActionErrors(); 114 115 String submit = request.getParameter("submit"); 116 117 if ((pathName == null) || (pathName.length()<1)) { 120 errors.add("pathName", 121 new ActionError("error.pathName.required")); 122 } 123 return errors; 125 } 126 } 127 | Popular Tags |