1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
<center>
    <h2>request 테스트 폼</h2>
    <hr>
    <form action="requestForm.jsp" method = "get">
        <table border="1 solid">
            <tr>
                <td>이름</td>
                <td><input type="text" name = "name"></td>
            </tr>
            <tr>
                <td>직업</td>
                <td>
                    <select name = "job">
                        <option>무직</option>
                        <option>전문직</option>
                        <option>기타</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>관심분야</td>
                <td>
                    <input type="checkbox" name="interest" value="정치"> 정치
                    <input type="checkbox" name="interest" value="사회"> 사회
                    <input type="checkbox" name="interest" value="정보통신"> 정보통신
                </td>
            </tr>
        </table>
        <input type="submit" value="확인" >
        <input type="reset" value="취소">
            
    </form>
</center>
</body>
</html>
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4f; text-decoration:none">Colored by Color Scripter
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<%@ 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 charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
<center>
    <h2>request 테스트 결과</h2>
    <hr>
    이름 : <%=request.getParameter("name"%><br>
    직업 : <%=request.getParameter("job"%><br>
    관심분야 : 
    <% //체크박스 values를 배열로 가져옴
        String[] num = request.getParameterValues("interest");
        for(int i = 0; i < num.length;i++)
            out.print(num[i]);
    %>
</center>
</body>
</html>
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4f; text-decoration:none">Colored by Color Scripter
 

'Servlet & JSP' 카테고리의 다른 글

JSP 예제_forward/sendRedirect  (0) 2019.06.21
JSP 예제_쿠키  (0) 2019.06.21
JSP 예제_구구단 출력  (0) 2019.06.21
JSP 선언, 표현식, 스크립트릿  (0) 2019.06.21
액션(ACTION)  (0) 2019.06.21

+ Recent posts