SpringMVC uses jsp: include to embed pages (recommended). springmvcjsp
1. Static embedded subpage
<% @ Include file = "header. jsp" %>
Static embedding supports jsp, html, xml, and plain text.
Static embedding is completed during compilation, which is equivalent to directly inserting the text of the Child page into the position of the include tag. The child page can directly use the variables in the parent page.
2. dynamically embed subpages
When Using jsp: include, you must set the flush attribute to true.
<Jsp: include page = "/main/header. jsp" flush = "true"/>
Otherwise, the subpage reports a 500 error during nesting.
<%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%><jsp:include page="/main/header.jsp" flush="true"/>
<Div class = "right"> <div class =" wFont ">
The above two methods for springMVC to embed pages using jsp: include (recommended) are all the content shared by Alibaba Cloud xiaobian. I hope you can provide a reference and support for our guests.