mark {
background: #ff0;
color: #000;
}
<c:otherwise>
<c:forEach var="item" items="${output }" varStatus="status">
<c:set var="title" value="${item.title}" />
<c:set var="content" value="${item.content }"/>
<c:if test="${keyword !=''}">
<%-- 검색어에 <mark> 태그를 적용하여 형광팬 효과 준비 --%>
<c:set var="mark" value="<mark>${keyword}</mark>" />
<%--출력을 위해 주니한 학과이름과 위치에서 검색어와 일치하는 단어를 형광팬 효과로 변경 --%>
<c:set var="title"
value="${fn:replace(title, keyword, mark)}" />
<c:set var="content"
value="${fn:replace(content, keyword, mark)}" />
</c:if>
<%--상세 페이지로 이동하기 위한 URL --%>
<c:url value="/notice/${item.postNo }/post_view.do" var="viewUrl" />
<tr>
<td class="text-center">${(pageData.totalCount - status.index) - ( (pageData.nowPage - 1) * pageData.listCount ) } </td>
<td class="text-center">
<a href="${viewUrl}">${title}
<c:forEach var="cmtCnt" items="${postCmtCntList}">
${cmtCnt.postNo eq item.postNo ? [cmtCnt.cmtCnt] :''}
</c:forEach>
</a>
</td>
<td class="text-center">${item.userId}</td>
<td class="text-center">${item.regdate}</td>
<td class="text-center">${item.hit}</td>
</tr>
</c:forEach>
댓글 ( 4)
댓글 남기기