当前位置:编程学习 > JAVA >>

jsp:include 问题求教

String childfile = "frame.jsp";
...........
...........
<jsp:include page="<%=childfile%>"/>


frame.jsp文件就是文件的根目录下,但是在运行的时候报错如下:
org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 63

60: <input type=hidden name="txt_edit" value="<%=strEdit%>">
61: <input type=hidden name="txt_search" value="<%=strSearch%>">
62: <input type=hidden name="txt_page" value="">
63: <jsp:include page="<%=childfile%>"/>
64: </td></tr></table>
65: </form>
66: <script>


说是63行有错   63: <jsp:include page="<%=childfile%>"/>
这行哪里错了?
--------------------编程问答-------------------- 把:
String childfile = "frame.jsp";
...........
...........
<jsp:include page="<%=childfile%>"/>
改为:
<%@ include file="frame.jsp"%>就不出错,这是为什么? --------------------编程问答-------------------- 很明显,不支持你这种用法啊 --------------------编程问答--------------------
引用 2 楼 Acesidonu 的回复:
很明显,不支持你这种用法啊


那怎么才能支持呢? --------------------编程问答-------------------- 路径,你可以去百度下看看区别 --------------------编程问答-------------------- <jsp:include page="<%=childfile%>"/> page中直接写路径就是! --------------------编程问答--------------------
引用 5 楼 anybyb 的回复:
<jsp:include page="<%=childfile%>"/> page中直接写路径就是!

我想在 page中放变量呀. --------------------编程问答-------------------- http://dangry.iteye.com/blog/868422/
看看这个链接可以解决不? --------------------编程问答-------------------- 貌似动态还真有问题,这个以前还讨论过
http://www.blogjava.net/renyangok/articles/56138.html
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,