<% String userIp = request.getRemoteAddr(); System.out.println("userIp : " + userIp); boolean isAllow = false; String allowIps[] = new String[] { "1.2" , "2.3.4.5" , "0:0:0:0:0:0:0:1" , "127.0.0.1" }; for(int i=0; i < allowIps.length; i++) { if(userIp.indexOf(allowIps[i]) != -1) { isAllow = true; break; } }
if(!isAllow) { %> <script language="javascript"> alert("접근 권한이 없습니다."); document.location = "main"; </script> <% return; } %>
|