<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!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=EUC-KR">
<title>Insert title here</title>
<style type="text/css">
p {
font-size: 100px;
color: red;
font-weight: bold;;
font-style: italic;
}
</style>
</head>
<body>
<%
int num = 100;
int sum = 0;
for(int i = 0; i < num; i++) sum += i+1;
%>
<p><%=sum %></p>
</body>
</html>
==================================================
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!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=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<table border="1">
<tr>
<%
int num = 10;
for (int i = 0; i < num; i++) {
%>
<td>
<%=
i+1
%>
</td>
<%
}
%>
</tr>
</table>
</body>
</html>
==================================================
<!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=EUC-KR">
<title>Insert title here</title>
</head>
<body>
<%
int num1 = Integer.parseInt(request.getParameter("num1"));
int num2 = Integer.parseInt(request.getParameter("num2"));
%>
<%=num1 + num2%><br>
<%=num1 - num2%><br>
<%=num1 * num2%><br>
<%=num1 / num2%><br>
<%!public int sum(int a, int b) {
return a + b;
}
public int min(int a, int b) {
return a - b;
}
public int mul(int a, int b) {
return a * b;
}
public int div(int a, int b) {
return a / b;
}%>
<%=sum(num1, num2) %><br>
<%=min(num1, num2) %><br>
<%=mul(num1, num2) %><br>
<%=div(num1, num2) %><br>
</body>
</html>
==================================================
==================================================
'노트필기' 카테고리의 다른 글
[Web] JSPClass0720-2 (0) | 2017.07.20 |
---|---|
[Web] JSPClass0720-1 (0) | 2017.07.20 |
[Web] Servlet class07-19 (0) | 2017.07.19 |
[Web] CSS class0718-1 (0) | 2017.07.18 |
[Web] JSP class 0717-1 (0) | 2017.07.17 |