page드렉티브

contentType : JSP가 생성할 문서의 타입을 지정한다. "text/html or "text/xml or "text/plain"
errorPage: JSP페이지를 실행하는 도중에 에러가 발생할 때 보여줄 페이지를 지정한다.

useImportCalendar.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import = "java.util.Calendar" %>
<!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=UTF-8">
<title>Calendar 클래스 사용</title>
</head>
<body>
	<%
		Calendar cal = Calendar.getInstance();

	%>
	
	오늘은
		<%= cal.get(Calendar.YEAR) %>년
		<%= cal.get(Calendar.MONTH)+1 %>월
		<%= cal.get(Calendar.DATE) %>일
	입니다.
</body>
</html>





URL/URI의 구분




+ Recent posts