2017년 7월 4일 화요일

Spring Boot Webjar 연습

소스:

https://github.com/julyinsung/springboot/tree/master/boot_mvc_webjar

환경:

Type: gradle
Packaging: Jar
Java Version: 1.8,
Boot Version: 1.5.4
MyBatis, MySQL, Thymeleaf, Web


참조:

http://www.namooz.com/2015/12/02/spring-boot-thymeleaf-9-webjars/
도서: spring mvc4 익히기

개요:

webjar를 이용하여 구성.

설명:

프로젝트 구성은 이전 Mybatis 연습과 동일


build.gradle에 설정 이때 bootstrap 대신 materialize 사용
 compile('org.webjars:jquery:2.1.4')
 //compile('org.webjars:bootstrap:3.3.4')
 compile('org.webjars:materializecss:0.96.0')

아래 html에서 보듯이 이 자원의 접근경로는 /webjars 밑에 위치하게된다.
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />

<script th:src="@{/webjars/jquery/2.1.4/jquery.min.js}"></script>

<script src="/webjars/materializecss/0.96.0/js/materialize.js"></script>

<link href="/webjars/materializecss/0.96.0/css/materialize.css"
 type="text/css" rel="stylesheet" media="screen,projection" />

댓글 1개: