개발/jsp
jstl 변수 선언
카앙구운
2015. 10. 8. 10:23
728x90
반응형
jstl-1.2.jar를 lib에 추가후 사하다.
변수선언 및 간단한 계산
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!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=UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:set var="a" value="테스트"/>
${a}<br>
<c:set var="b" value="10"/>
${b}<br>
<c:set var="c" value="20"/>
${b+c}<br>
<c:set var="d" value="${b*c}"/>
${d}<br>
</body>
</html>
728x90
반응형