博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JSP中include指令简介
阅读量:4185 次
发布时间:2019-05-26

本文共 684 字,大约阅读时间需要 2 分钟。

1、简介

        jsp中include指令的形式为:

  <%@ include file=" " %>
  通常当应用程序中所有的页面的某些部分(例如标题、页脚和导航栏)都相同的时候,就可以考虑用include。<%@ include file=" "%>,jsp的include指令元素读入指定页面的内容。并把这些内容和原来的页面融合到一起。(这个过程是在翻译阶段:也就是jsp被转化成servlet的阶段进行的。)

2、和jsp:include动作指令的不同

       include与jsp:include主要有两个方面的不同;

  一是执行时间上:
         <%@ include file=”relativeURI”%> 是在翻译阶段执行
        <jsp:include page=”relativeURI” flush=”true” /> 在请求处理阶段执行.
  二是引入内容的不同:
        <%@ include file=”relativeURI”%>    引入静态文本(html,jsp),在JSP页面被转化成servlet之前和它融和到一起.
        <jsp:include page=”relativeURI” flush=”true” />   引入执行页面或servlet所生成的应答文本.
              另外在两种用法中file和page属性都被解释为一个相对的URI.如果它以斜杠开头,那么它就是一个环境相关的路径.将根据赋给应用程序的URI的前缀进行解释,如果它不是以斜杠开头,那么就是页面相关的路径,就根据引入这个文件的页面所在的路径进行解释。

参考文献:百度百科

转载地址:http://sqdoi.baihongyu.com/

你可能感兴趣的文章
CareerCup Cost of cutting wood
查看>>
Find the number of subsets such that the sum of numbers in the subset is a prime number
查看>>
CareerCup Binary Tree the Maximum of 人
查看>>
CareerCup Divide n cakes to k different people
查看>>
CareerCup Randomly return a node in a binary tree
查看>>
CareerCup Given a sorted array which contains scores. Write a program to find occurrence
查看>>
CareerCup The number of pairs (x, y) of distinct elements with condition x + y <= Threshold
查看>>
Build a key-value data structure which can perform lookup and rangeLookup(key1, key2)
查看>>
整数划分问题---动态规划、递归
查看>>
Balanced Partition
查看>>
Number of 1s
查看>>
CareerCup Find all the conflicting appointments from a given list of n appointments.
查看>>
CareerCup Given an array having positive integers, find a subarray which adds to a given number
查看>>
CareerCup Generate all the possible substrings
查看>>
CareerCup Given an array A[], find (i, j) such that A[i] < A[j] and (j - i) is maximum.
查看>>
Brain Teaser 球变色
查看>>
(2)考试大纲---信息系统项目管理师考试系列
查看>>
(3)教材目录---信息系统项目管理师考试系列
查看>>
商城基础E-R模型图
查看>>
飞翔的小鸟--键盘事件案例
查看>>