Spring Boot Admin
利用 Spring Boot 可以快速開發客製化應用系統, 而這些由 Spring Boot 框架建立的應用系統則可以利用 Spring Boot Admin 來作統一的管理. 由這系統可以讓您知道 Application Server 的版本如: Java , Tomcat , session .... 等, 所以在管理這些服務系統架構中...監控管理是非常重要的一環
Server 端

MIS 發表在 痞客邦 留言(0) 人氣()

Document 解析 XML 檔案時, 解析的值總是為 NULL , 解決方法如下:
先把檔案用 StringBuilder 變成字串後, 再作解析就可以

MIS 發表在 痞客邦 留言(0) 人氣()

在 Spring Boot 使用 Freemarker 模板來快速建立客製化的標籤 (taglib) 是非常簡單的事. 作下列幾個步驟即可.
Step 01:  設定一個 Freemarker Template:  /src/main/resources/templates/demo/ftlTagSample.ftl

MIS 發表在 痞客邦 留言(0) 人氣()

build.gradle
buildscript {
ext {
springBootVersion = '2.0.4.RELEASE'
jjwtVersion = '0.9.0'
findbugsVersion='3.0.1'
bootstrapVersion = '3.3.7'
jqueryVersion = '3.3.1'
vueVersion ='2.5.13'
fontawesomeVersion = '5.2.0'
jspapiVersion = '2.3.3'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
/*
* 在這個段落中你可以聲明使用哪些外掛程式
* apply plugin: 'java' 代表這是一個Java專案,需要使用java外掛程式
* 如果想生成一個 `Intellij IDEA` 的工程,類似的如果要生成
* eclipse工程,就寫 apply plugin: 'eclipse'
* 同樣的我們要學的是Spring Boot,所以應用Spring Boot外掛程式
*/
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
// 在這個段落中你可以聲明編譯後的Jar檔資訊
bootJar {
baseName = 'myspring'
group = 'com.polinwei'
version = '0.0.1-SNAPSHOT'
}
// 在這個段落中你可以聲明原始檔案和目標編譯後的Java版本相容性
sourceCompatibility = 1.8
targetCompatibility = 1.8
// 在這個段落中你可以聲明在哪裡可以找到你的項目依賴
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://code.lds.org/nexus/content/groups/main-repo"}
maven { url "http://maven.aliyun.com/nexus/content/repositories/central"}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.springframework.boot:spring-boot-starter-freemarker")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-security")
compile("org.springframework.security:spring-security-taglibs")
compile("org.springframework.boot:spring-boot-devtools") // Class 程式有更改時, 自動重啟
compile("org.hibernate.validator:hibernate-validator") //驗證
compile("javax.servlet.jsp:javax.servlet.jsp-api:${jspapiVersion}")
compile("org.springframework.session:spring-session-data-redis")
compile("org.springframework.boot:spring-boot-starter-data-redis")
runtime("mysql:mysql-connector-java")
compileOnly("org.projectlombok:lombok")
compile("com.maxmind.geoip2:geoip2:2.12.0")
compile("io.jsonwebtoken:jjwt:${jjwtVersion}")
compile("com.google.code.findbugs:findbugs:${findbugsVersion}")
compile("org.webjars:bootstrap:${bootstrapVersion}")
compile("org.webjars:jquery:${jqueryVersion}")
compile("org.webjars:vue:${vueVersion}")
compile("org.webjars:font-awesome:${fontawesomeVersion}")
compile("org.webjars.bowergithub.lipis:flag-icon-css:3.1.0")
compileOnly("org.springframework.boot:spring-boot-configuration-processor")
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.springframework.security:spring-security-test")
}

MIS 發表在 痞客邦 留言(0) 人氣()

實現pdfmake使用中文本體主要就是編譯新的vfs_fonts.js代替原來vfs_fonts.js文檔引入到前端頁面中,為了編譯出新的字體文檔,下列是中文顯示的解決方法,供大家參考:
操作系統:Windows

MIS 發表在 痞客邦 留言(0) 人氣()

使用 Hibernate Tool 去產生 Domain Code ( Model ) 時, 當 User.java & Authority.java 有相互參考時, 在 spring boot 使用 @RestController 會發生 Direct self-reference leading to cycle 的錯誤訊息, 解決的方法可以在 Domain Code ( Model ) 上加上 @JsonManagedReference & @JsonBackReference 來防止錯誤.
 

MIS 發表在 痞客邦 留言(0) 人氣()

springboot-taglib.jpg
SpringBoot+SpringSecurity+Freemarker專案中在頁面上使用security標籤控制按鈕顯示隱藏達到對按鈕級許可權控制還是比較方便的,如下配置即可。
1. gradle 引入依賴

MIS 發表在 痞客邦 留言(0) 人氣()

除了 痞客邦 PIXNET 使用 Syntax Highlighter 顯示程式碼 以外, 也可以使用 highlight.js 來讓 pixnet 顯示程式碼
在後台管理的 側欄管理, 選擇 頁尾描述加入

MIS 發表在 痞客邦 留言(0) 人氣()

Spring Boot + Freemarker 多語言國際化的作法
1. 在 application.properties 增加

MIS 發表在 痞客邦 留言(0) 人氣()

使用 Hibernate Tool 產生 Model 時, FetchType 預設是 FetchType.LAZY , 但在執行時, 卻常會產生類似下列 no Session 的錯誤訊息
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.spring.jwt.db.maria.model.authentication.User.userAuthorities, could not initialize proxy - no Session

MIS 發表在 痞客邦 留言(0) 人氣()

使用 Spring Boot 2 建置系統就是希望快速. 若專案範圍小的話, 資料庫倒是可以考慮使用 H2 database 來建罝
在 build.gradle 上加入

MIS 發表在 痞客邦 留言(0) 人氣()

 環境: ApacheFriends XAMPP Version 7.1.7

  + Apache 2.4.26
  + MariaDB 10.1.25
  + PHP 7.1.7 (VC14 X86 32bit thread safe) + PEAR
  + phpMyAdmin 4.7.0
  + OpenSSL 1.0.2f
  + ADOdb 518a
  + Mercury Mail Transport System v4.63 (not included in the portable version)
  + FileZilla FTP Server 0.9.41 (not included in the portable version)
  + Webalizer 2.23-04 (not included in the portable version)
  + Strawberry Perl 5.16.1.1 Portable
  + Tomcat 7.0.56
  + XAMPP Control Panel Version 3.2.2 by hackattack142

MIS 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。