在springboot中集成bootstrap

比较简单,不要想的太复杂了。

首先导入依赖bootstrap与jquery:


		
		
			org.webjars
			bootstrap
			3.3.5
		
		
			org.webjars
			jquery
			3.1.1
		
然后在html文件中加入相应版本:






  

Insert title here


	

hello zhangyan

Button

.btn 类是按钮的基本样式:

关键的三句:



 

项目结构图:

然后就可以了。

不要在poi.xml中加build那些,尝试会有问题。

注:Spring Boot 会从以下路径寻找静态文件:

  • /META-INF/resources/
  • /resources/
  • /static/
  • /public/

Controller代码如下:

@Controller
public class BackIndexController {

	@RequestMapping(value = "/",method = RequestMethod.GET)
	public String index() {
		
		return "backindex.html";
	}
	
}
需要加入后缀。


你可能感兴趣的:(JavaWEB)