jsp中include.inc

来源:互联网 发布:pop3和smtp端口被占用 编辑:程序博客网 时间:2024/05/21 08:30
include指令 .  

作用:是用来向当前页中插入一个静态文件的内容,这个文件可能是html文件、jsp文件或其它文本文件,格式如下: 根据专家观察,这样的理论和现象都是值得各位站长深思的,所以希望大家多做研究学习,争取总结出更多更好的经验!  

<%@ include file=”include.inc”%>
如:
native.jsp:
<body>
native file start here.<br>
<%@ include file=”include.inc”%>
native file end here.<br>
</body>
include.inc:
include file start here.<br>
<%! String str=”Here is include’s context!”;%>
<% out.pringln(str ”<br>”);%>
include file end here.<br>
运行native.jsp,结果如下:
native file start here.
include file start here.
Here is include’s context!
include file end here.
native file end here. 根据专家观察,这样的理论和现象都是值得各位站长深思的,所以希望大家多做研究学习,争取总结出更多更好的经验!  

注意:因为include.inc文件是在编译时才插入的,所以只改 include.inc文件内容,而不对原JSP页面做修改,得到的结果仍将是以前的结果。(因为一开始JSP引擎就判断了JSP页面没被改动过,就直接执行已存在的字节码,而不对源代码重新编译,这样对include做的修改也就在这没有反映。) .
0 0