bean:resource和bean:include区别

来源:互联网 发布:淘宝15天退货规则 编辑:程序博客网 时间:2024/06/04 20:36

试一下代码就知道,原来bean:resource导入的是源文件(就是本地文件的读取),而bean:include导入的是已经编译好的一个html文件(就是网络读取出的文件),试一下如下代码,要自己建立相应文件。

 

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html lang="true">
 <bean:include id="mytemp" page="/regist.jsp"/>
 <bean:write name="mytemp" filter="true"/>
 <hr>
 <bean:resource id="mytemp" name="/regist.jsp"/>
 <bean:write name="mytemp" filter="true"/>
 <hr>
 <bean:include id="mytemp" href="http://www.baidu.com"/>
 <bean:write name="mytemp" filter="true"/>
</html:html>

 

这个jsp就能看出他们源代码的不同之处,看来什么东西只有试了就最清楚了。

原创粉丝点击