Freemarker가 내 템플릿 파일을 UTF-8로 구문 분석하려고하지만 Cp1252로 파싱하는 것으로 보입니다.freemarker 템플릿에서 <#ftl> 지시어 사용
2013-07-30 00:00:00.984 DEBUG freemarker.cache:? Could not find template in cache, creating new one; id=["myFile.ftl"["es_MX",Cp1252,parsed] ]
검색 한 결과 found that adding the FTL directive을 입력하면 인코딩을 지정할 수 있습니다.
<#ftl encoding="UTF-8">
Estimado Usuario,
Testing this content!
<#/ftl>
을하지만 로그에이 얻을 :
그래서 같은 (메모장에서 BOM ++와 UTF-8로 저장) 템플릿 파일에 추가.
MessageTemplateException [message=Unable to process template due to Encountered "<#ftl " at line 1, column 4 in myFile.ftl.
Was expecting one of:
<EOF>
<ATTEMPT> ...
<IF> ...
<LIST> ...
<FOREACH> ...
<SWITCH> ...
<ASSIGN> ...
<GLOBALASSIGN> ...
<LOCALASSIGN> ...
<_INCLUDE> ...
<IMPORT> ...
<FUNCTION> ...
<MACRO> ...
<TRANSFORM> ...
<VISIT> ...
<STOP> ...
<RETURN> ...
<CALL> ...
<SETTING> ...
<COMPRESS> ...
<COMMENT> ...
<TERSE_COMMENT> ...
<NOPARSE> ...
<BREAK> ...
<SIMPLE_RETURN> ...
<HALT> ...
<FLUSH> ...
<TRIM> ...
<LTRIM> ...
<RTRIM> ...
<NOTRIM> ...
<SIMPLE_NESTED> ...
<NESTED> ...
<SIMPLE_RECURSE> ...
<RECURSE> ...
<FALLBACK> ...
<ESCAPE> ...
<NOESCAPE> ...
<UNIFIED_CALL> ...
<WHITESPACE> ...
<PRINTABLE_CHARS> ...
<FALSE_ALERT> ...
"${" ...
"#{" ...
with inputs of {loginUrl=testURL} in myFile.ftl with locale es_MX, code=SUCCESS, arguments=[]]
어쩌면 내가 제대로하지 않을 것입니까?