jsp에서 <c:out>을 쓰는것이 바람칙하다.

Web Development assistant·2021년 12월 4일
0

# html

목록 보기
7/13
<c:if test="{msg != null}"
	first_msg = ${msg}
   	second_msg = <c:out value="${msg}"/>
</c:if>

일때 msg에

asdf

이면
first_msg에 html태그가 먹혀서
p태그에 감싸진 asdf가 출력되고

second_msg는 html태그를 문자열 그대로의

asdf

를 출력한다.

자바스크립트로 인한 보안취약성을 잡을 수 있다.

0개의 댓글