Two Methods for JSP file inclusion

Source: Internet
Author: User
1   //  First: include command: When JSP is converted to servlet, the specified file <% @ page contenttype = "text/html; charset = gb2312 "Language =" Java "errorpage =" %>  2 <% @ Include file = "head. jsp" %> 3 <% @ Include file = "body. jsp" %> 4 <% @ Include file = "tail. jsp" %> 5   //  Type 2: <JSP: Include> action element: Introduce the specified file when the JSP page is requested  6 <% @ Page contenttype = "text/html; charset = gb2312" Language = "Java" errorpage = "" %>7 <JSP: Include page = "head. jsp"/> 8 <JSP: Include page = "body. jsp"/> 9 <JSP: Include page = "tail. jsp"/> 10     11     12   //  The second method can easily use <JSP: param> to pass parameters to included pages. The method is as follows:  13 <% @ Page contenttype = "text/html; charset = gb2312" Language = "Java" errorpage = "" %> 14 <JSP: Include page = "head. jsp"/> 15 <JSP: Include page = "body. jsp"> 16 <JSP: Param name = "uid" value = "username"/> 17 <JSP: Param name = "PWD" value = "password"/> 18 </Jsp: Include> 19 <JSP: Include page = "tail. 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.