request.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>Implicit Object</title>
</head>
<body>
<!--
form 페이지
요청경로 : process.jsp
요청 파라미터 : name=개똥이(입력 양식 이름 = 값)
요청 방식 : post
-->
<form action="process.jsp" method="get">
<!-- 폼 데이터 -->
<p>
<!-- required : 필수 입력 -->
이름 : <input type="text" name="name" placeholder="이름" required/>
<input type="submit" value="전송" />
</p>
</form>
</body>
</html>
![]() |
![]() |
process.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<!--
요청경로 : process.jsp
요청 파라미터 : name=개똥이(입력 양식 이름 = 값)
요청 방식 : post
-->
<%
//내장 객체.메소드(인코딩)
request.setCharacterEncoding("UTF-8");//한글 처리
// 변수 내장객체 폼 페이지에서 입력된 데이터를 전달하는 요청 파라미터 값을 가져옴
String name = request.getParameter("name");//개똥이
%>
<p>이름 : <%=name%></p>
</body>
</html>
결과 | ![]() |
'JSP 웹 프로그래밍 > 수업내용' 카테고리의 다른 글
[JSP 웹 프로그래밍] reponse 내장 객체 (0) | 2024.07.01 |
---|---|
[JSP 웹 프로그래밍]내장 객체 예제 2 (0) | 2024.07.01 |
[JSP 웹 프로그래밍] 내장 객체 (0) | 2024.06.28 |
[오라클] 계정 생성 및 권한 부여 (0) | 2024.06.28 |
[JSP 웹 프로그래밍] JSTL이란? / 사용방법 (0) | 2024.06.26 |