Programming

(JSP) 서버관련 정보 가져오기

steloflute 2012. 5. 28. 11:03

http://kamsi76.springnote.com/pages/1435720

 

 

<%@ page language="java" pageENCODING="EUC-KR"%>
<%@ page import="java.net.InetAddress" %>


클라이언트ip <%=request.getRemoteAddr()%><br>
요청URI <%=request.getRequestURI()%><br>
컨텍스트경로 <%=request.getContextPath()%><br>
서버이름 <%=request.getServerName()%><br>
서버포트 <%=request.getServerPort()%><br>
<br>
requested URL: <%=request.getRequestURL()%><br>
requested Info: <%=request.getRequestURI()%><br>

<%
// 요거이 그겁니다. 서버 ip
InetAddress inet= InetAddress.getLocalHost();
%>
server ip: <%=inet.getHostAddress()%>