+++ 202108/src/main/webapp/calc.html
... | ... | @@ -0,0 +1,20 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html> | |
3 | +<head> | |
4 | +<meta charset="UTF-8"> | |
5 | +<title>Calculator</title> | |
6 | +</head> | |
7 | +<body> | |
8 | + <form action="calc.jsp" method="post"> | |
9 | + <input type="text" name="num1"> | |
10 | + <select name="op"> | |
11 | + <option value="+">+</option> | |
12 | + <option value="-">-</option> | |
13 | + <option value="*">*</option> | |
14 | + <option value="/">/</option> | |
15 | + </select> | |
16 | + <input type="text" name="num2"> | |
17 | + <input type="submit" value="Run"> | |
18 | + </form> | |
19 | +</body> | |
20 | +</html>(No newline at end of file) |
+++ 202108/src/main/webapp/calc.jsp
... | ... | @@ -0,0 +1,32 @@ |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | + pageEncoding="UTF-8"%> | |
3 | +<% | |
4 | + String num1 = request.getParameter("num1"); | |
5 | + String op = request.getParameter("op"); | |
6 | + String num2 = request.getParameter("num2"); | |
7 | +%> | |
8 | +<!DOCTYPE html> | |
9 | +<html> | |
10 | +<head> | |
11 | +<meta charset="UTF-8"> | |
12 | +<title>Calculating Result</title> | |
13 | +</head> | |
14 | +<body> | |
15 | + <% | |
16 | + int result = 0; | |
17 | + if(op.equals("+")){ | |
18 | + result = Integer.parseInt(num1) + Integer.parseInt(num2); | |
19 | + } | |
20 | + else if(op.equals("-")){ | |
21 | + result = Integer.parseInt(num1) - Integer.parseInt(num2); | |
22 | + } | |
23 | + else if(op.equals("*")){ | |
24 | + result = Integer.parseInt(num1) * Integer.parseInt(num2); | |
25 | + } | |
26 | + else { | |
27 | + result = Integer.parseInt(num1) / Integer.parseInt(num2); | |
28 | + } | |
29 | + out.print("계산 결과 = " + result); | |
30 | + %> | |
31 | +</body> | |
32 | +</html>(No newline at end of file) |
+++ 202108/src/main/webapp/check.jsp
... | ... | @@ -0,0 +1,18 @@ |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | + pageEncoding="UTF-8"%> | |
3 | +<% | |
4 | + String id = request.getParameter("id"); | |
5 | + String pw = request.getParameter("pw"); | |
6 | + out.print(id); | |
7 | + out.print(pw); | |
8 | +%> | |
9 | +<!DOCTYPE html> | |
10 | +<html> | |
11 | +<head> | |
12 | +<meta charset="UTF-8"> | |
13 | +<title>Login Check</title> | |
14 | +</head> | |
15 | +<body> | |
16 | + | |
17 | +</body> | |
18 | +</html>(No newline at end of file) |
+++ 202108/src/main/webapp/login.html
... | ... | @@ -0,0 +1,14 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html> | |
3 | +<head> | |
4 | +<meta charset="UTF-8"> | |
5 | +<title>Login Page</title> | |
6 | +</head> | |
7 | +<body> | |
8 | + <form action="check.jsp" method="post"> | |
9 | + ID : <input type="text" name="id"><br><br> | |
10 | + P/W : <input type="password" name="pw"> | |
11 | + <input type="submit" value="Login"> | |
12 | + </form> | |
13 | +</body> | |
14 | +</html>(No newline at end of file) |
+++ 202108/src/main/webapp/test.jsp
... | ... | @@ -0,0 +1,24 @@ |
1 | +<%@ page language="java" contentType="text/html; charset=UTF-8" | |
2 | + pageEncoding="UTF-8"%> | |
3 | +<!DOCTYPE html> | |
4 | +<html> | |
5 | +<head> | |
6 | +<meta charset="EUC-KR"> | |
7 | +<title>Insert title here</title> | |
8 | +<style> | |
9 | + #container {background-color: grey; color: white;} | |
10 | +</style> | |
11 | +</head> | |
12 | +<body> | |
13 | + <div id="container"> | |
14 | + 오늘 날자와 시간은 <%=new java.util.Date() %>입니다. | |
15 | + <% | |
16 | + int a = 1; | |
17 | + int b = 2; | |
18 | + int c = a+b; | |
19 | + %> | |
20 | + <br> | |
21 | + 자바로 계산한 결과는 = <%=c %> | |
22 | + </div> | |
23 | +</body> | |
24 | +</html>(No newline at end of file) |
--- Servers/Tomcat v9.0 Server at localhost-config/server.xml
+++ Servers/Tomcat v9.0 Server at localhost-config/server.xml
... | ... | @@ -60,7 +60,7 @@ |
60 | 60 |
APR (HTTP/AJP) Connector: /docs/apr.html |
61 | 61 |
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 |
62 | 62 |
--> |
63 |
- <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/> |
|
63 |
+ <Connector connectionTimeout="20000" port="8081" protocol="HTTP/1.1" redirectPort="8443"/> |
|
64 | 64 |
<!-- A "Connector" using the shared thread pool--> |
65 | 65 |
<!-- |
66 | 66 |
<Connector executor="tomcatThreadPool" |
... | ... | @@ -153,7 +153,7 @@ |
153 | 153 |
Note: The pattern used is equivalent to using pattern="common" --> |
154 | 154 |
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/> |
155 | 155 |
|
156 |
- </Host> |
|
156 |
+ <Context docBase="202108" path="/202108" reloadable="true" source="org.eclipse.jst.jee.server:202108"/></Host> |
|
157 | 157 |
</Engine> |
158 | 158 |
</Service> |
159 | 159 |
</Server>(No newline at end of file) |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?