SpringMVC uses jsp: include to embed pages (recommended). springmvcjsp

Source: Internet
Author: User

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.

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.