thymeleaf (8) 썸네일형 리스트형 [Spring + Thymeleaf] 국제화 메세지 처리 Thymeleaf 에서 메세징 처리를 위해서는 다음과 같이 적용할 수 있다. servlet-context.xml META-INF/message/messages 에 파일 추가 messages_en.propertiestest=testtest.param=Test {0} messages_ko.propertiestest=테스트test.param=테스트 {0} Test.html 에서의 thymeleaf 문법 또는 기본값기본값 기본값 ${#messages.msg('test')} 는 test 키 값이 없을 경우 ??test?? 라는 기본 메세지 형태로 출력이 되고${#messages.msgOrNull('test')} 의 경우에는 null 을 리턴한다. 위의 설정대로 진행하면 URL 요청시 파라메터로 ?lang=en, .. [Thymeleaf] contextPath in Javascript Thymeleaf 는 HTML 의 속성값을 이용하여 파싱을 한다. 결국 TAG에 적용된 값들을 토대로 파싱을 하는데 자바스크립트에서의 파싱도 지원을 한다. 자세한 내용은 문서를 참고하기 바란다. 자바스크립트에서 contextPath 의 값을 가져오기 위해서는 다음 값들을 사용할 수 있다. 그 외 다양한 방법들 관련해서도 마찬가지로 문서를 참고하기 바란다. 단지 기록차원에서 블로그에 글을 남겨둔다. 참고 : Tutorial: Using Thymeleaf (http://www.thymeleaf.org/doc/html/Using-Thymeleaf.html#script-inlining-javascript-and-dart) [Thymeleaf] Thymol Static Imports 제목에서 말하듯 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 Extras Thymeleaf - Tiles 2 integration module https://github.com/thymeleaf/thymeleaf-extras-tiles2 Thymeleaf - Module for Internet Explorer conditional comments https://github.com/thymeleaf/thymeleaf-extras-conditionalcomments 스프링(spring) + 타임리프(thymeleaf) 연동시 한글처리 Spring + Thymeleaf 연동시 한글 처리 sprng 에 thymeleaf 연동시 기본설정으로 한글이 깨지는 것을 볼 수 있다. 이때 다음과 같은 설정으로 한글처리를 할 수 있다. 아래의 방법으로 다른언어도 UTF-8 처리를 하여 깨지는 현상을 막을 수 있다. 1. web.xml ### xmlencodingFilterorg.springframework.web.filter.CharacterEncodingFilterencodingUTF-8encodingFilter/*spring encoding 을 위한 설정 2. servlet-context.xml### xmlThymeleafViewResolver 에 characterEncoding 값을 설정한다. 참고 UTF8 charset problem : ht.. [타임리프] From JSP to Thymeleaf 개요 웹 개발자와 퍼블리셔가 작업을 하면서 JSP 와 HTML 코드를 어떻게 관리해야 두번 작업 안하게 할까? 라는 고민에서 시작되었다. 보통 작업을 하면 HTML 관련 프로젝트는 퍼블리셔가 담당하고 이것을 개발자가 JSP 등의 웹 개발 언어로 개발하면서 두개의 프로젝트로 관리되어 작업을 해왔다. 그러면서 자연스럽게 웹개발자와 퍼블리셔가 프로젝트를 분리하지 않고 하나의 프로젝트에서 관리할 수 있는 방법은 없을까? 하는 생각이 들었다. 퍼블리셔 : 로컬에서 서버없이 화면을 제작/수정하고자 함웹개발자 : 서버를 통해 전달한 데이터를 포함한 온전한 화면의 개발 이쯤에 접한것이 바로 타임리프였다. 타임리프는 자바 라이브러리로 웹환경뿐만 아니라 서버없이도 동작하는 XML/XHTML/HTML5 템플릿 엔진이다. 타.. [Maven] thymeleaf-extras-springsecurity3-2.0.0 다운로드 실패 현상 Thymeleaf 와 Spring Security 3.x 를 통합하는 과정에서 Maven info 를 등록 하였지만 다운로드가 실패하는 원인을 발견하였다. thymeleaf-extras-springsecurity3-2.0.0.pom 파일이 열리지 않는 현상이었다. Maven infogroupId: org.thymeleaf.extrasartifactId: thymeleaf-extras-springsecurity3version: 2.0.0 해결 원격 저장소의 thymeleaf-extras-springsecurity3-2.0.0.pom 파일이 수정되면 좋겠지만 일단 로컬저장소에 관련 jar 파일을 등록하여 해결하였다. mvn install:install-file -Dfile=e:\thymeleaf-ext.. Spring MVC + Thymeleaf * 테스트 환경 - Windows 7 64bit- STS 3.2.0 ( VMware vFabric tc Server Developer Edition v2.7 )- thymeleaf 2.0.17 Spring MVC + Thymeleaf 적용 STS를 이용하여 Spring MVC + Thymeleaf 적용하기 1. Spring MVC 프로젝트 생성2. pom.xml### xmlorg.thymeleafthymeleaf2.0.17org.thymeleafthymeleaf-spring32.0.17org.thymeleafthymeleaf-testing2.0.3 3. servlet-context.xml### xml 4. home.html### html Thymeleaf Hello world! The time on th.. 이전 1 다음