JSP <c:url value='/~'/>사용시 404 status

LeeWonjin·2022년 8월 18일
0

문제해결

목록 보기
8/21

문제

<c:url>이 정상적으로 동작하지 않는다.

<%@page contentType="text/html; charset=utf-8" %>

<html>
<body>
	<a href="<c:url value='/main'/>">[ Go to Main ]</a>
</body>
</html>
HTTP 상태 404 – 찾을 수 없음

타입 상태 보고
메시지 요청된 리소스 [/~~/%3Cc:url%20value='/main'/%3E]은(는) 가용하지 않습니다.

설명 Origin 서버가 대상 리소스를 위한 현재의 representation을 찾지 못했거나, 
그것이 존재하는지를 밝히려 하지 않습니다.

Apache Tomcat/9.0.65

해결

<c:url>은 jstl이 제공하는 기능이다. taglib를 추가한다.

<%@page contentType="text/html; charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
   ...

What is JSTL? Where does it come from?
JSTL is the Java Server Pages Standard Tag Library. It is an effort of the Java Community Process (JCP) and comes out of the JSR-052 expert group. - oracle jstl getting stated

참고

profile
노는게 제일 좋습니다.

0개의 댓글