제목에서 말하듯 Thymeleaf 를 사용시 Thymol 을 통해 html 파일에서의 정적임포트가 가능하다. Thymeleaf 를 이용하여 include 한 파일을 jquery 의 get() 을 통해 해당 위치를 태그를 대체하는 형태로 동작하는데 크롬에서는 다음과 같은 에러를 발생하며 작동하지 않는다. (버전 28.0.1500.95 m)
Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. file:///C:/dev/workspace/proj1/src/main/webapp/WEB-INF/views/common/menu.html
이때 해당 사이트에서 제시한 아래의 방법을 적용하면 정적인 임포트가 가능하다. 그렇다고 Thymeleaf 의 모든 include 를 지원하는 것은 아니다. 퍼블리셔가 공통으로 작성한 html 에 대한 include 정도(?)라고 보면 될것 같다. 스크립트 공통 선언과 관련해서는 좀 더 찾아봐야 하겠다.
e.g. <path-to-chrome-home>chrome.exe --allow-file-access-from-files
참고 |
Thymol Static Imports : http://sourceforge.net/u/jjbenson/wiki/thymol/#static-imports
Thymol Browser Constraints : http://sourceforge.net/u/jjbenson/wiki/thymol/#browser-constraints
'Tip > Spring' 카테고리의 다른 글
Redirect를 Post 요청으로? (0) | 2013.10.17 |
---|---|
스프링(Spring) 에서의 리다이렉트(redirect:) (0) | 2013.10.11 |
Thymeleaf Extras (0) | 2013.08.14 |
spring MVC + tiles 2.2.2 (0) | 2013.08.13 |
스프링(spring) + 타임리프(thymeleaf) 연동시 한글처리 (0) | 2013.08.06 |