본문 바로가기

개발하자/JSP&Servlet

getInitParameterNames(),getInitParameter()

aa.jsp

===========================================

<%@page import="java.util.Enumeration"%>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
 pageEncoding="EUC-KR"%>
 <%
 Enumeration<String> arr=application.getInitParameterNames();
  while(arr.hasMoreElements()){
   String name=arr.nextElement();
   out.println(name);
   out.println(":"+application.getInitParameter(name)+"<br>");
  }
 %>

 

web.xml

============================================

<context-param>
<param-name>aa</param-name>
<param-value>bb</param-value>
</context-param>
<context-param>
<param-name>cc</param-name>
<param-value>dd</param-value>
</context-param>

</web-app>

'개발하자 > JSP&Servlet' 카테고리의 다른 글

URIEncoding-한글깨질때 설정방법  (0) 2015.02.23
getRealPath("/"),getContextPath()  (0) 2015.02.23
getAttribute,getParameter  (0) 2015.02.23
request.getContextPath--절대경로  (0) 2015.02.23
FileReader ,FileWriter  (0) 2015.02.19