본문 바로가기
목차
Spring (boot) 오류 해결

JSTL if문 학습

by 지각생 2022. 2. 18.
728x90
<c:if test="${channelName} ne ${getChannelName}">
	<li class="nav-item"><a class="nav-link" href="/index/${getChannelName}"> ${getChannelName}</a></li>
</c:if>

test="${channelName} ne ${getChannelName}"

위에 if문 조건 test가 왜 안먹힐까? 하다 검색해보며 알아보다가 아래와 같이 수정하니 먹혔다.

 

<c:if test="${channelName ne getChannelName}">
	<li class="nav-item"><a class="nav-link" href="/index/${getChannelName}"> ${getChannelName}</a></li>
</c:if>

test="${channelName ne getChannelName}"

 

알고보면 쉬운건데 흠..

728x90

댓글