수업을 들으며 타이핑 후 run 실행하였으나 500 에러 발생함.
원인 : jstl 주소 미숙지함.
<!-- fruit.jsp -->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2>원하는 과일을 선택하세요.</h2>
<Form action="fruitSelect.jsp" method="post">
<select name="fruit">
<option value="1">apple</option>
<option value="2">strawberry</option>
<option value="3">banana</option>
<option value="4">melon</option>
</select>
<input type="submit" value="제출">
</Form>
</body>
</html>
<!-- fruitSelect.jsp -->
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:choose>
<c:when test="${param.fruit==1 }">
<span style="color: red">apple</span>
</c:when>
<c:when test="${param.fruit==2 }">
<span style="color: pink">strawberry</span>
</c:when>
<c:when test="${param.fruit==3 }">
<span style="color: yellow">banana</span>
</c:when>
<c:when test="${param.fruit==4 }">
<span style="color: green">melon</span>
</c:when>
</c:choose>
</body>
</html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
주소 수정 후 해결됨.