Springboot (ii)--Support JSP

Source: Internet
Author: User

Springboot Although JSP is supported, it is not recommended by the Government. Look online said, after all, JSP is the technology of elimination, tears run, just contact on the elimination.

Springboot how to integrate JSP:

1. Configure Application.properties

    # page Default prefix directory    spring.mvc.view.prefix=/web-inf/jsp/    # response page default suffix    spring.mvc.view.suffix =.jsp

2. Join the dependency

    <Dependency>         <groupId>Org.apache.tomcat.embed</groupId>         <Artifactid>Tomcat-embed-jasper</Artifactid>         <Scope>Provided</Scope>     </Dependency>     <Dependency>        <groupId>Javax.servlet</groupId>         <Artifactid>Jstl</Artifactid>     </Dependency>

3. The control layer recommends using @controller, do not use @restcontroller, after all, not every method will return JSON, and some need to jump to the interface.

Springboot (ii)--Support 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.