廣告聯播

2018年8月10日 星期五

Create a Multi Language web application with Spring Boot & FreeMarker

From: Polin Wei

Spring Boot + Freemarker 多語言國際化的作法

1. 在 application.properties 增加
# ===============================
# Multi Language
# ===============================
spring.messages.basename=i18n/messages
2.Control file: MainController.class
@Controller
public class MainController {
@RequestMapping(value = { "/","/home" })
public String staticResource(Model model) {
return "home";
}
}

沒有留言:

張貼留言