Skip to content

Instantly share code, notes, and snippets.

@seriwb
Created March 28, 2015 15:20
Show Gist options
  • Select an option

  • Save seriwb/f842a527d69a950cac74 to your computer and use it in GitHub Desktop.

Select an option

Save seriwb/f842a527d69a950cac74 to your computer and use it in GitHub Desktop.
check the request scope on jsp
<%@page pageEncoding="UTF-8" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Scopeチェックコード</title>
</head>
<body>
<%@page import="java.util.Enumeration" %>
<%
StringBuilder sb = new StringBuilder();
Enumeration<String> names = request.getParameterNames();
while (names.hasMoreElements()) {
String name = names.nextElement();
String vals[] = request.getParameterValues(name);
if (vals != null) {
for (int i=0; i < vals.length; i++) {
sb.append(name).append(":").append(vals[i]).append("<br>");
}
}
}
%>
<%= sb.toString() %>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment