자바스크립트에서 백틱(`)을 사용하면 편리하게 문자열을 다룰 수 있다.
const a = 'test';
console.log(`this is just a ${a}`);
// this is just test
하지만 JSP에서는 이 달러 기호가 EL 표현식으로도 사용되기 때문에 정상적으로 작동하지 않을 수 있다.
JSP에서 템플릿 문자열을 사용할 때는 백슬래쉬(\)를 사용한다.
const a = 'test';
console.log(`this is just a \${test}`);
// this is just test
'웹 개발 > 오류' 카테고리의 다른 글
Not supported for DML operations (0) | 2023.04.17 |
---|---|
Spring Boot와 MariaDB 연동 후 java.util.concurrentmodificationexception: null (0) | 2023.03.27 |
Type [java.lang.String] is not valid for option items (0) | 2023.02.10 |
Spring - 요청 데이터로 JSON을 보냈을 때 상태코드 415 (0) | 2023.02.02 |
Spring - MultipartFilter 설정 후 한글이 깨지는 현상 (0) | 2023.01.30 |