SpringBoot2 x 控制層路徑對映

2021-09-02 15:34:43 字數 533 閱讀 9101

在controller層中可以通過以下方式對同一資料夾下的多個html對映。

import org.springframework.stereotype.controller;

import org.springframework.web.bind.annotation.pathvariable;

/** * 圖書相關頁面控制層

* ***************====

* @author notalent

* @version 1.0

*/@controller

public

class

bookcontroller")

public string bookrouter

(@pathvariable string path)

}

通過@pathvariable從url獲取路徑變數,自動對template裡面的html檔案進行路徑對映。

基於SpringBoot 2 X整合Druid

說明 本文旨在整理springboot 2.x整合druid基礎功能,如有問題請指出 參考資料 基於springboot 2.x版本,這裡是引入druid spring boot2 starter的方式來配置,所以不需要不需要configbean來配置druid,如果引入的是druid,則需要con...

SpringBoot2 x 整合Druid詳細步驟

druid spring boot starter模式 這種方式比較簡單,不需要自己寫配置類。在匯入依賴以及配置好配置檔案yml即可。pom.xml com.alibaba druid spring boot starter 1.1.10 spring datasource url jdbc mys...

springboot2 x基礎 整合redis

在springboot中一般使用redistemplate提供的方法來操作redis。那麼使用springboot整合redis 需要那些步驟呢。環境安裝 任選 centos7 搭建redis 5單機服務 centos7 搭建 redis 5 cluster 集群服務 在專案中新增 spring b...