Last active
December 1, 2015 08:09
-
-
Save Cartman0/f6a38bfe3cddbc865a13 to your computer and use it in GitHub Desktop.
jspのサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%-- Pageディレクティブ --%> | |
<%@page contentType="text/html" pageEncoding="UTF-8"%> | |
<%@page import="java.util.ArrayList" %> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>JSP Page</title> | |
</head> | |
<body> | |
<% | |
ArrayList<String> list = new ArrayList<String>(); | |
list.add("はしくれ"); | |
list.add("エンジニア"); | |
list.add("もどきの"); | |
list.add("メモ"); | |
%> | |
<h1> | |
<% for(int i = 0; i<list.size(); i++){ %> | |
<%-- スクリプト式 --%> | |
<%= list.get(i) %> | |
<% } %> | |
</h1> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment