본문 바로가기

개발하자/JSP&Servlet

키값만 뽑아내기

http://localhost:8282/p1/a.jsp?a=100&a=200&b=300&c=aaa

a
b
c

[an]
a.jsp
=====
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%@ page import="java.util.*" %>
<%
Map<String,String[]> map=request.getParameterMap();
Set<String> set=map.keySet();
for(String key : set){
out.write(key+"<br>");
}
%>