프로그래밍 정리/JSP, Servlet, DB(oracle)

웹 프로그래밍 20-2(JSP)-JSTL 기초, Core를 사용해보자

Wooni0477 2020. 1. 6. 11:30
반응형
웹 프로그래밍 20-2(JSP)-JSTL 기초, Core를 사용해보자


*JSTL-core를 사용해 보자

소스를 보면서 연습해보자

-jstlcore.jsp

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

<%@ page language="java" contentType="text/html; charset=EUC-KR"

pageEncoding="EUC-KR"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">

<title>Insert title here</title>

</head>

<body>

<c:set var="varName" value="varValue" /> //변수 선언

varName : <c:out value="${varName}" />

<br />

<c:remove var="varName" />

varName : <c:out value="${varName }"/> //변수 값 제거

<br />

<c:forEach var="fe" begin="0" end="100" step="5"> //for문 0-100까지 5씩 증가

${fe} //for문 값 출력

</c:forEach>

</body>

</html>

-출력 화면


반응형