<%@ page contentType="text/html; charset=UTF-8"%>
<%
// 이전페이지(SendAndReceive06.jsp → 자기 자신 페이지)로부터 데이터
// (userInput)수신
request.setCharacterEncoding("UTF-8");
String temp = "";
temp = request.getParameter("userInput");
if(temp == null)
temp = "없음";
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>SendAndReceive06.jsp</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div>
<h1>데이터 송수신 실습 06</h1>
<hr>
</div>
<div>
<!-- <form action="Test999.jsp" method="post">
입력 <input type="text" id="userInput" name="userInput" class="txt"><br>
<button type="submit" class="btn control">테스트</button>
<button type="reset" class="btn control">취소</button>
</form> -->
<!-- <form action="" method="post">
입력 <input type="text" id="userInput" name="userInput" class="txt">
<br>
<button type="submit" class="btn control">테스트</button>
<button type="reset" class="btn control">취소</button>
</form> -->
<!-- <form action="" method="get">
입력 <input type="text" id="userInput" name="userInput" class="txt">
<br>
<button type="submit" class="btn control">테스트</button>
<button type="reset" class="btn control">취소</button>
</form> -->
<!-- <form method="get">
입력 <input type="text" id="userInput" name="userInput" class="txt">
<br>
<button type="submit" class="btn control">테스트</button>
<button type="reset" class="btn control">취소</button>
</form> -->
<form method="post">
입력 <input type="text" id="userInput" name="userInput" class="txt">
<br>
<button type="submit" class="btn control">테스트</button>
<button type="reset" class="btn control">취소</button>
</form>
<!-- ※ form의 action 속성을 『action=""』과 같이 구성하거나
action 속성을 생략하여 『form method="post"』와 같이 구성하면
페이지 요청 및 데이터 전송에 대한 수신처 페이지는 자기 자신이 된다. -->
</div>
<div>
<h2>수신된 데이터 확인</h2>
<h3>→ <%=temp %></h3>
</div>
</body>
</html>
728x90
'WEB Archive' 카테고리의 다른 글
[HTML] 회원가입 폼 만들기 (0) | 2024.08.22 |
---|---|
[HTML] form.submit() 활용한 구구단 출력 (0) | 2024.08.22 |
[HTML] Calendar 객체 활용해서 달력 만들기 - 만년달력 (0) | 2024.08.22 |
[HTML] 만년달력 구하기 (0) | 2024.08.22 |
[HTML] 달력출력하기 (0) | 2024.08.22 |
댓글