신고 기능과 에러(jstl 태그,jsp주석처리)
<c:if test="${memberNickname != com.nickname && memberNickname != null}">
<button type="button" class="btn btn-dark mt-3"data-toggle="modal"
data-target="#reportModal" class="btn btn-danger mt-3" >신고</button>
</c:if>
눈물의 신고쇼.......
조건 : 세션에 저장된 (현재 로그인 된) 회원의 닉네임이 존재하고 그 닉네임이 게시글 작성자 닉네임과 다르면
신고할수 있게 한다
난 자꾸 작성자 닉네임과 같거나(OR) 닉네임 자체가 없는 비로그인 회원이면 신고가 안 나와야지 ~ 생각하고 if 식 쓰고 &&은 생각도 못하고 ||만 적었네 ~~~
오늘의 에러메세지
1. javax.servlet.jsp.JspTagException: Illegal use of <when>-style tag without <choose> as its direct parent

원인
<c:when 태그 쓰는데 <c:choose 태그 먼저 안해줘서
해결
<c:choose ~>태그 먼저 쓰고 <c:when ~>태그 쓰기
2. org.apache.jasper.JasperException: <h3>[/view/~~~~.jsp] 내의 [c]을(를) 위한 TagLibraryValidator로부터 Validation 오류 메시지들</h3><p>460: Illegal text inside

원인
<c:choose~태그 안에 주석으로 <!-- --> 넣을 수 없음
<!-- -->주석은 html에서 주석을 처리하는 방식
<%-- -->주석이 jsp에서 주석을 처리하는 방식
(<!-- -->로 주석 처리 하면 주석처리한것과 같이 색깔이 변하는데 실제로는 처리가 된게 아니다)
Spring (STS4) <c:choose>태그 안쪽 주석 오류
HTTP Status 500 – Internal Server Error Type Exception Report Message Validation error messages from TagLibraryValidator for [c] in [/WEB-INF/views/home.jsp] 56: Illegal text inside "c:choose" tag:..
dlgkstjq623.tistory.com
해결
<%-- -->로 바꿔주기
최종 완성
프론트에서 신고여부 비교해서 신고는 한번만 가능하게!
<c:choose>
<%--리스트값에 이미 닉네임이 있다면 거절모달 --%>
<c:when test="${fn:contains(nickList, memberNickname) }">
<button type="button" class="btn btn-dark mt-3"data-toggle="modal"
data-target="#rejectModal" class="btn btn-danger mt-3" >신고</button>
</c:when>
<%--리스트값에 닉네임이 없다면 신고등록모달 --%>
<c:otherwise>
<button type="button" class="btn btn-dark mt-3"data-toggle="modal"
data-target="#reportModal" class="btn btn-danger mt-3" >신고</button>
</c:otherwise>
</c:choose>
신고 거의 다 끝났고
원 게시물 작성자에게 알림만 주면 된다
내일은 다른 조원이 작성한 알림 흐름 파악하고 알림 완료하기가 목표!