您的位置:程序门 -> java -> web 开发



jsp加载html文件出现问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


jsp加载html文件出现问题[无满意答案结贴,结贴人:dashi99]
发表于:2007-09-29 07:58:47 楼主
include.jsp文件
<%@   page   contenttype="text/html;   charset=gb2312"   %>
<%@   page   language="java"   %>
<html>
<head>
<title> 加载文件 </title>
</head>
<body>
<center>
<font   size   =   10   color   =   blue> 加载文件 </font>
</center>
<br>
<hr>
<br>
<center>
<font   size=5   color=blue>
<!--   加载文件   htminsert.html-->
<%@   include   file="htminsert.html"   %>
</font>
</center>
</body>
</html>


htminsert.html文件
<html>
<head>
<title> html   file </title>
</head>
<body>
这是加载的   html   文件
</body>
</html>


当在浏览器窗口输入http://localhost:8088/example/05/include.jsp时显示页面如下:
加载文件
---------------------------


请问后边怎么不显示“这是加载的   html   文件”这些字,好象没有加载上去,这是为什么啊?我用的是tomcat6,请各位指教。谢谢
发表于:2007-09-29 08:18:571楼 得分:0
请各位帮一下忙啊
发表于:2007-09-29 08:26:112楼 得分:0
换成 <jsp:include   page=“htminsert.html”   flush=“true”/>
发表于:2007-09-29 08:29:213楼 得分:0
<%@   include   file="htminsert.html"   %   >  
这里的include指令包含一个网页片段,tomcat解析时直接把另一个页面包含进去,也就是说你包含的内容是一个片段,不是一个完整的html
<font   size=5   color=blue   >  
<!--   加载文件   htminsert.html--   >  
<%@   include   file="htminsert.html"   %   >  
</font   >  
你在font中加入内容的
所以你另一个页面是
<div> 这是加载的   html   文件  
</div>
就可以
发表于:2007-09-29 09:04:204楼 得分:0
2楼:
换成   <jsp:include   page=“htminsert.html”   flush=“true”/   >
---------------------------------------------------------
我试了2楼的方法,但是那是加载动态内容的,不好使,不知道是怎么回事,但还是谢谢了


快速检索

最新资讯
热门点击