IT
Java 태그 및 특수 문자 치환 함수 예시 / Egov Spring Controller
agnusdei1207
2022. 7. 18. 07:38
반응형
SMALL
public static String unEscape(final String strString) throws Exception{
String strNew = XssPreventer.unescape(strString);
strNew = strNew.replaceAll("<", "<");
strNew = strNew.replaceAll(">", ">");
strNew = strNew.replaceAll("&", "&");
strNew = strNew.replaceAll(""", "\"");
strNew = strNew.replaceAll("·", "·");
strNew = strNew.replaceAll("‘", "‘");
strNew = strNew.replaceAll("’", "’");
return strNew;
}
1. 사용자가 태그나 특수 기호를 사용했을 경우 이를 DB 에 저장하기 전 Controller 치환하는 함수
반응형
LIST