SpringBoot+MyBatias+Jsp 发布和部署,用tomcat启动

来源:互联网 发布:直发夹板 知乎 编辑:程序博客网 时间:2024/05/10 01:14

1.首先要用本地tomcat启动。右键工程properties,  找到Project Facts。变成Dynamic Web Module项目。如图


2.修改POM.XML,把jar变成war

<packaging>war</packaging>

3.把新建WebContent\WEB-INF\views\       jsp放入views下面如图


4.在application.properties 中配置

spring.mvc.view.prefix=/WEB-INF/views/
spring.mvc.view.suffix=.jsp

5.发布tomcat.就能解决



通过以上方式能解决。用main方法启动,加载jsp没问题。用tomcat启动,加载jsp报错的问题。解决如下问题

ERROR 1045 --- [nio-8080-exec-8] o.s.boot.context.web.ErrorPageFilter : Cannot forward to error page for request [/] as the response has already been committed. As a result, the response may have the wrong status code. If your application is running on WebSphere Application Server you may be able to resolve this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService to false


0 0
原创粉丝点击