超详细解决SpringBoot启动过后不能访问jsp页面的问题

1、首先看SSM(Spring+SpringBoot+Mybatis)的依赖


	4.0.0
	com.easyshop.springboot.web
	easyshop
	0.0.1-SNAPSHOT
	war

	
		org.springframework.boot
		spring-boot-starter-parent
		1.5.2.RELEASE
	

	
		
		
			org.springframework.boot
			spring-boot-starter-web
		

		
		
			org.springframework
			spring-aspects
		
		
		
			cglib
			cglib-nodep
			2.1_3
		
		
		
			commons-logging
			commons-logging
			1.2
		

		
		
			org.mybatis
			mybatis
			3.3.0
		

		
		
			org.mybatis
			mybatis-spring
			1.2.2
		
	
		
			mysql
			mysql-connector-java
			5.1.28
		
		
			com.alibaba
			druid
			1.1.10
		

		
		
			jstl
			jstl
			1.2
		

		
		
			org.springframework.boot
			spring-boot-starter-jdbc
		

		
		
			org.apache.tomcat.embed
			tomcat-embed-jasper
		

	

	
		
			
			
				org.springframework.boot
				spring-boot-maven-plugin
			
		
		
			
				src/main/java
				
					**/*.xml
					**/*.properties
				
				true
			
			
				src/main/resources
				
					**/*.xml
					**/*.properties
				
				true
			
		
	


 

2、看两种启动方式不同进行访问jsp页面

第一种,直接maven启动超详细解决SpringBoot启动过后不能访问jsp页面的问题_第1张图片

可以直接访问jsp

超详细解决SpringBoot启动过后不能访问jsp页面的问题_第2张图片

超详细解决SpringBoot启动过后不能访问jsp页面的问题_第3张图片

 第二种

写一个类来达到访问的目的

超详细解决SpringBoot启动过后不能访问jsp页面的问题_第4张图片

访问是一样的,这两种方法都可以选择,这是我百度了很久找出来的法子!可以解决springboor访问jsp的问题!

补充一下 这里的File里面的路径是webapp的绝对路径哦! 

 

你可能感兴趣的:(SpringBoot)