<11_selectForm.jsp>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form method="get" action="11_selectList.jsp">
<input type="checkbox" name="item" value="신발">신발
<input type="checkbox" name="item" value="가방">가방
<input type="checkbox" name="item" value="벨트">벨트<br>
<input type="checkbox" name="item" value="모자">모자
<input type="checkbox" name="item" value="시계">시계
<input type="checkbox" name="item" value="주얼리">주얼리
<br><br>
<input type="submit" value="전송">
</form>
</body>
</html>
<11_selectList.jsp>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h3>당신이 선택한 항목입니다.</h3>
<hr>
<c:forEach var="item" items="${paramValues.item }" varStatus="status">
${item }<c:if test="${not status.last }">, </c:if></c:forEach>
</body>
</html>
728x90
반응형
'JSP, Servlet > JSP, Servlet 기초' 카테고리의 다른 글
[JSP] c태그 사용하기(<c:import>) (0) | 2020.08.13 |
---|---|
[JSP] c태그 사용하기 (<c:forTokens>) (0) | 2020.08.13 |
[JSP/Servlet] c태그 사용하기 (<c:forEach begin="" end="" step="">) 활용 - 1 (0) | 2020.08.13 |
[JSP/Servlet] c태그 사용하기 (<c:forEach begin="" end="" step="">) (0) | 2020.08.13 |
[JSP/Servlet] c태그 사용하기(<c:forEach varStatus="">) (0) | 2020.08.13 |