<%@ include file="" %>是将文件原封不动的copy进现有的文件中,像是拼接好后,再编译成为servlet运行。

  <jsp:include page=""></jsp:include>是编译后的servlet运行到该句时,跳转到指定的jsp编译的那个servlet继续运行,然后将运行结果,copy到现在的jsp中,故包含与被包含文件都是单独运行的。

在开发过程中,我们需要正确选择使用。举个例子:

  比如在工程项目中,每个jsp文件需要引入包含公共js和css文件信息的jsp文件,由于相对路径的问题的存在,我们需要在head标签中添加<base href="<%=basePath%>">,而此时,在<%@ include file="" %>时便会报错。

详见:http://www.cnblogs.com/brolanda/p/4143905.html

 

jsp的静态包含与动态包含:<%@ include file="" %>和<jsp:include page=""></jsp:include>区别与分析的更多相关文章

  1. JSP页面的静态包含和动态包含

    JSP中有两种包含:静态包含:<%@include file="被包含页面"%>和动态包含:<jsp:include page="被包含页面" ...

  2. JSP页面静态包含和动态包含的区别与联系

    ---恢复内容开始--- JSP页面静态包含和动态包含的区别与联系: 1.<%@ include file=" " %> 是指令元素,<jsp:include p ...

  3. JSP静态包含和动态包含的区别和联系

    JSP页面的静态包含和动态包含 JSP中有两种包含:静态包含:<%@include file="被包含页面"%>和动态包含: <jsp:include page= ...

  4. java Web jsp页面的静态包含和动态包含

    现在有头 体 尾 三个jsp页面 top.jsp <%@ page language="java" contentType="text/html; charset= ...

  5. JSP静态包含和动态包含

    JSP中有两种包含: 静态包含:<%@include file="被包含页面"%>: 动态包含:<jsp:include page="被包含页面&quo ...

  6. JSP页面的静态包含和动态包含的区别与联系

    JSP中有两种包含: 静态包含:<%@include file="被包含页面"%> 动态包含:<jsp:include page="被包含页面" ...

  7. 关于JSP页面的静态包含和动态包含

    JSP中有两种包含:静态包含:<%@include file="被包含页面"%> 和 动态包含:<jsp:include page="被包含页面&quo ...

  8. java web jsp原理图 ,静态包含,动态包含,out与response.getWrite()

    jsp原理图 ,静态包含,动态包含,out与response.getWrite() 

  9. jsp中的include静态包含与动态包含,

    d动态包含与静态包含的最大区别是 静态包含:<%@ include file = "文件名.jsp"%>,在<body>的标签外定义.在没有编译的时候,两个 ...

随机推荐

  1. Ehcache(2.9.x) - API Developer Guide, Cache Usage Patterns

    There are several common access patterns when using a cache. Ehcache supports the following patterns ...

  2. Jedis - hello world

    Maven Dependency: <dependency> <groupId>redis.clients</groupId> <artifactId> ...

  3. java内存被释放的小例子

    先贴代码: StringBuilder dada = null; ; i<; i++){ dada = new StringBuilder(); ; j<; j++){ dada.appe ...

  4. Android Studio工程目录介绍

    来自知乎: Android Studio工程目录结构 .gradle 是gradle运行以后生成的缓存文件夹. .idea 是android studio/Intellij IDEA工程打开以后生成的 ...

  5. Entity Framework 6.1-Code First

    原文:Entity Framework 6.1-Code First Code First-代码优先,先创建好领域模型.新建MyDbContext继承DbContext.根据代码自动生成数据库 Cod ...

  6. IOS 异步GET方法请求

    1.添加协议NSURLConnectionDelegate 2.引入头文件“NSString+URLEncoding”,用来处理URL进行编码. 3.引入头文件“NSNumber+Message”,用 ...

  7. IO&Seralize

    IO <appSettings> <!--日志路径--> <add key="LogPath" value="E:\学习\C#进阶\fsoc ...

  8. BT之下拉菜单

    <div class="dropdown"> <button class="btn btn-default dropdown-toggle" ...

  9. 函数 sort,unique,stable_sort,count_if,谓词

    bool isShorter(const string &s1,const string &s2) { return s1.size() < s2.size(); } bool ...

  10. encodeURIComponent=>Uri.EscapeDataString

    javascript: encodeURIComponent=> C#: Uri.EscapeDataString http://stackoverflow.com/questions/5754 ...