| ¸®´ª½º °ü·Ã °Ô½ÃÆÇ |
|---|
| 2025/06/05(19:10) from 180.65.248.107 | |
| ÀÛ¼ºÀÚ : ÁÖÀÎÀå | Á¶È¸¼ö : 170 , ÁÙ¼ö : 50 |
| Re: [JBoss & Apache] 1. index.jsp ¼Ò½ºÄÚµå |
|---|
|
<html> <body> <h2>JBoss EAP Test Page!!</h2> <br> I am JulKi</br> <br> <br> </body> </html> <%@ page import="javax.servlet.http.HttpServletRequest" %> <%@ page import="java.net.InetAddress" %> <% // HttpServletRequest °´Ã¼¸¦ ÅëÇØ Ŭ¶óÀ̾ðÆ®ÀÇ IP ÁÖ¼Ò¸¦ °¡Á®¿É´Ï´Ù. String ipAddress = request.getHeader("X-Forwarded-For"); if (ipAddress == null || ipAddress.isEmpty() || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getHeader("Proxy-Client-IP"); } if (ipAddress == null || ipAddress.isEmpty() || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getHeader("WL-Proxy-Client-IP"); } if (ipAddress == null || ipAddress.isEmpty() || "unknown".equalsIgnoreCase(ipAddress)) { ipAddress = request.getRemoteAddr(); } // IP ÁÖ¼Ò¸¦ Ãâ·ÂÇÕ´Ï´Ù. out.println("Client IP Address : " + ipAddress); out.println("<br><br>"); InetAddress inetAddress = InetAddress.getLocalHost(); //out.println("Server IP Address : " + inetAddress.getHostAddress() + "<br>"); if (inetAddress.getHostAddress().equals("192.168.56.101")) { out.println("Server IP Address : " + inetAddress.getHostAddress() + " <font color=green>(O)</font>" + "<br>"); out.println("Server IP Address : " + "192.168.56.102" + " <font color=red>(X)</font>" + "<br>"); } if (inetAddress.getHostAddress().equals("192.168.56.102")) { out.println("Server IP Address : " + inetAddress.getHostAddress() + " <font color=green>(O)</font>" + "<br>"); out.println("Server IP Address : " + "192.168.56.101" + " <font color=red>(X)</font>" + "<br>"); } %> |
|
|
|