-
Request 객체의 메소드 사용하여 웹브라우저와 서버의 정보를 출력하는 예제WEB/JSP 2018. 10. 24. 22:51
|Request 객체의 메소드 사용하여 웹브라우저와 서버의 정보를 출력하는 예제
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>title</title>
<script type="text/javascript" src="/js/jquery-3.3.1.min.js"></script>
<style>
</style>
<script>
</script>
</head>
<body>
<%@ page contentType="text/html; charset=UTF-8" %>
<b>request 객체정보</b>
<%="인코딩방식: "+request.getCharacterEncoding()+"" %>
<%="MIME 타입: "+request.getContentType()+"<p>" %>
<%="요청정보길이: "+request.getContentLength()+"<p>" %>
<%="헤더이름: "+request.getHeaderNames()+"<p>" %>
<%="웹 전달 경로: "+request.getPathInfo()+"<p>" %>
<%="클라이언트 이름: "+request.getRemoteHost()+"<p>" %>
<%="클라이언트 IP주소: "+request.getRemoteAddr()+"<p>" %>
<%="클라이언트 URL 경로: "+request.getRequestURI()+"<p>" %>
<%="전송방식: "+request.getMethod()+"<p>" %>
<%="프로토콜 이름: "+request.getProtocol()+"<p>" %>
<%="서버이름: "+request.getServerName()+"<p>" %>
<%="서버 포트 번호: "+request.getServerPort()+"<p>" %>
</body>
</html>
'WEB > JSP' 카테고리의 다른 글
favicon img 생성 및 적용하기 (0) 2018.11.05 홈페이지 주소 기본 페이지 설정 (0) 2018.11.04 jsp include file 응용 (0) 2018.10.23 jsp 경로를 이동하면 파일 다운로드 받는 방법 (0) 2018.10.23 JSP 에러페이지 (0) 2018.10.23 댓글