<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!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>Insert title here</title>
</head>
<body>
초기 파라미터 조회<br>
Config초기파라미터 : <%=config.getInitParameter("name") %><br>
Context초기파라미터 : <%=application.getInitParameter("name") %>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>myjsp</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>name</param-name>
<param-value>Context 초기파라미터</param-value>
</context-param>
<!-- jsp 설정 -->
<servlet>
<servlet-name>init param</servlet-name>
<jsp-file>/implicit_var/init_param.jsp</jsp-file>
<init-param>
<param-name>name</param-name>
<param-value>Config 초기 파라미터</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>init param</servlet-name>
<url-pattern>/init_param</url-pattern>
</servlet-mapping>
</web-app>