requestTest2.jsp > MODEL

본문 바로가기

사이트 내 전체검색

뒤로가기 MODEL

requestTest2.jsp

페이지 정보

작성자 관리자 작성일 21-07-15 18:40 조회 1,478 댓글 0

본문

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>


<%@page import="java.util.Enumeration"%>


<!DOCTYPE html> 

<html>

<head>

<title>Request Test2</title>

<style>

h1 {

text-align: center;

}


table {

border: 1px solid red;

}

</style>

</head>

<body>


<h1>헤더정보 예제</h1>

<table width=1000>

<tr>

<td width=200>헤더이름</td>

<td width=800>헤더값</td>

</tr>

<%

// Enumeration 인터페이스 정리

// 객체들의 집합에서 각각의 객체들을 한순간에 하나씩 처리할 수 있는 메소드 제공하는 컬렉션이다.


Enumeration e=request.getHeaderNames();

while(e.hasMoreElements()){

String headerName=(String)e.nextElement();

%>

<tr>

<td><%=headerName %></td>

<td><%=request.getHeader(headerName) %></td>

</tr>

<%}%>

</table>


</body>

</html>


추천0

댓글목록 0

등록된 댓글이 없습니다.


Copyright © dancePKT. All rights reserved.
PC 버전으로 보기