springboot-adding support for JSP

Source: Internet
Author: User

1, add the following dependencies in the project's configuration file

<dependency> <groupId>javax.servlet</groupId> <artifactid>javax.servlet-api& Lt;/artifactid> <scope>provided</scope> </dependency> <!--support JSP -<dependency> <groupId>javax.servlet</groupId> <artifactId> Jstl</artifactid> <version>1.2</version> </dependency> <!--Resolution access page 404--<dependency> <group            Id>org.apache.tomcat.embed</groupid> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> <!--set to provided will exclude the package when it is packaged, as it is to be run in a standalone Tomcat, is not needed. -<dependency> <groupId>org.springframework.boot</groupId> &LT;ARTIFAC Tid>spring-boot-starter-tomcat</artifactid> <scope>provided</scope> </dependency >

2. propertis file Configuration JSP resource path

#server. port=8089server.servlet-path=/#配置静态资源spring. Resources . static-locations=classpath:/public/#logging. level.org.springframework=  DEBUGspring.mvc.view.prefix=/web-inf/views/spring.mvc.view.suffix=.jsp

This allows for JSP support, and resolves the issue of page access return 404

springboot-adding support for JSP

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.