getRealPath기억해두기
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
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
<!-- application 객체는 웹 어플리케이션 전반에 걸쳐서 사용되는 정보르르 담고 있습니다. -->
<h2>application테스트</h2>
<table border="1">
<tr>
<td>Servlet API 스펙의 버전</td>
<td><%=application.getMajorVersion() %>.
<%=application.getMinorVersion() %></td>
</tr>
<tr>
<td>컨테이너 이름과 버전</td>
<td><%=application.getServerInfo()%></td>
</tr>
<tr>
<td>웹 어플리케이션의 실제 파일 시스템 경로</td>
<td><%=application.getRealPath("/") %></td>
</tr>
<!-- getRealPath("/") : /는 context 경로입니다. 즉, 웹 애플리케이션 경로까지 구하라는 의미입니다. -->
</table>
</body>
</html>
Colored by Color Scripter
|
'IT > JSP' 카테고리의 다른 글
application을 이용해 파라미터 이름과 값 불러오기 (0) | 2019.05.13 |
---|---|
web.xml 설정 (0) | 2019.05.13 |
페이지 이동하는 두 가지 방법 (redirect, dispatcher) (0) | 2019.05.13 |
xml 오류 (0) | 2019.05.12 |
이클립스에서 톰캣 사용하기2 (0) | 2019.05.08 |