Springboot-shiro Chapter02--springboot Webmvc JSP

Source: Internet
Author: User

Summary: This section is primarily about Spring boot support JSP, which has been a bit of a detour due to the lack of familiarity with spring boot.

Environment:
idea15+
jdk1.8+
maven3+

First, pom.xml resource dependence

Relative to Chapter01, there are more resources to rely on here. There is no direct reference to SPRING-WEBMVC, Spring-boot-starter, and Spring-boot-tomcat, as in Chapter01, but by referencing Spring-boot-starter-web resources.

It can be seen that spring-boot-starter-web contains Chapter01 resources, and in order to parse the JSP resources need to introduce jsaper, the JSP file precompiled into a Java file, and then compiled into a class file. The JVM can now load the corresponding class file for the JSP

In addition, JSTL (JSP standard Tag Library) resources are mainly JSP standards tag libraries, improve JSP development efficiency

Note: There is an indirect dependency of spring-boot-starter-parent on the <parent> node, otherwise there will be compile exceptions at compile time.

Second, springboot configuration

Here are the main settings for SPRINGMVC view parser related properties

Spring.mvc.view.prefix:/web-inf/jsp/spring.mvc.view.suffix:. jsp

Startclass differs from Chapter01, where Springbootservletinitializer is inherited primarily by inheriting this class to deploy the application to the servlet container

@SpringBootApplication @componentscan (value= "Com.shujushow") Public classChapter02applicationextendsSpringbootservletinitializer {@OverrideprotectedSpringapplicationbuilder Configure (Springapplicationbuilder application) {returnApplication.sources (chapter02application.class); }     Public Static voidMain (string[] args)throwsexception{Springapplication.run (chapter02application.class, args); }}

Springboot-shiro Chapter02--springboot Webmvc 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.