티스토리 뷰
728x90
SMALL
<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"
import="java.io.*, java.util.*"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%
//request에 저장된 모든 속성들을 가져와서 보여주자.
Enumeration en = request.getAttributeNames();
while(en.hasMoreElements()) {
//문자열로 캐스팅
String name = (String)en.nextElement();
//이 이름으로 속성값을 꺼낸다.
Object obj = request.getAttribute(name);
if(obj instanceof File) { //너 파일이니?
//파일 객체니까
File f = (File)obj;
out.println("파일 크기 : " + f.length() + "bytes<br/>");
} else {
//나머지는 다 문자열들이니까.
String value = (String)obj;
out.println(name + " : " + value + "<br/>");
}
}
%>
</body>
</html>
import="java.io.*, java.util.*"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%
//request에 저장된 모든 속성들을 가져와서 보여주자.
Enumeration en = request.getAttributeNames();
while(en.hasMoreElements()) {
//문자열로 캐스팅
String name = (String)en.nextElement();
//이 이름으로 속성값을 꺼낸다.
Object obj = request.getAttribute(name);
if(obj instanceof File) { //너 파일이니?
//파일 객체니까
File f = (File)obj;
out.println("파일 크기 : " + f.length() + "bytes<br/>");
} else {
//나머지는 다 문자열들이니까.
String value = (String)obj;
out.println(name + " : " + value + "<br/>");
}
}
%>
</body>
</html>
728x90
LIST
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 내돈내산
- 듀스
- 아웃사이더
- JS
- jQuery
- php
- 8마일
- 2ne1
- 카발온라인
- MySQL
- 랩배틀
- 자바스크립트
- Ajax
- Java
- 요리
- 함수
- EL
- Servlet
- 기타
- JSON
- 경제용어
- JSTL
- JSP
- asp
- I Don't Care
- 웹에이전시
- 복근운동
- JavaScript
- 서블릿
- 외톨이
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함
250x250