1 33 package net.myvietnam.mvncore.interceptor.sample; 34 35 import net.myvietnam.mvncore.interceptor.LoginIDInterceptor; 36 import net.myvietnam.mvncore.exception.InterceptorException; 37 38 46 public class NoBadLoginIDInterceptor implements LoginIDInterceptor { 47 48 public NoBadLoginIDInterceptor() { 49 } 50 51 57 public void validateLoginID(String loginID) throws InterceptorException { 58 loginID = loginID.toLowerCase(); 59 if (loginID.equals("sex") || 60 loginID.equals("moderator") || 61 loginID.equals("administrator") ) { 62 throw new InterceptorException("Cannot accept this loginID. Your loginID = " + loginID); 63 } 64 } 65 } 66 | Popular Tags |