-
Escape Sequence 문자Web (Spring ) 2016. 9. 19. 13:19
개요
자바스크립트 & JSP 내에서 동적html을 생성 할시에 헷갈리기에 이와같이 정리한다.
Escape sequence
Meaning
\b
Backspace
\f
Form feed (rarely used)
\n
Line feed (newline)
\r
Carriage return. Use with the line feed (\r\n) to format output.
\t
Horizontal tab
\v
Vertical tab. Not compliant with ECMAScript standard and incompatible with Microsoft Internet Explorer 6.0
\'
Single quote (')
\"
Double quote (")
\\
Backslash (\)
Result
1234567891011121314out.write("<html>\n");out.write("<head>\n");out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=EUC-KR\">\n");out.write("<title>Hello JSP</title>\n");out.write("</head>\n");out.write("<body>\n");out.write("<h1>Server Time: ");out.print( new java.util.Date() );out.write("</h1>\n");out.print( application.getRealPath("/") );out.write("\n");out.write("</body>\n");out.write("</html>");cs 출처 : http://twinstarbox.tistory.com/entry/Java-Escape-Sequence-%EB%AC%B8%EC%9E%90
'Web (Spring )' 카테고리의 다른 글
자주 쓰는 정규식 (0) 2016.09.23 selectkey return 값이 '1'일 경우 (0) 2016.09.19 JSON 정렬 (0) 2016.09.19 Ajax form.Serialize 안먹힐때 (0) 2016.09.02 [MVC게시판] 게시판 글 수정&삭제 (0) 2016.08.19