SPRINGMVC two ways to embed a page using Jsp:include

Source: Internet
Author: User

1. Static embedding of sub-pages

  <% @include file="header.jsp" %>

static embedding support jsp , html and xml plain text.

Static embedding is done at compile time, which is equivalent to inserting the text of a child page directly into include the location of the label. A child page can use variables directly from the parent page.

2. Dynamic embedding of sub-pages

 You jsp:include must set the property to when you use it flush true .

  <jsp:include page= "/main/header.jsp" flush= "true"/>

Otherwise, the child page will be reported 500 error when 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" >
<p> Welcome to the supermarket billing management system!</p>
</div>
</div>


<jsp:include page= "/main/footer.jsp" flush= "true"/>

SPRINGMVC two ways to embed a page using Jsp:include

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.