<%@ include file="JSP/index.jsp" %>会报错 我想在index.jsp中引用top.jsp 求解

如题所述

第1个回答  2011-04-03
<%@ include file="${pageContext.request.contextPath}JSP/top.jsp" %>追问

还是报错啊 而且我看不懂
有没有更好的办法呀 高手

追答


不好意思刚刚丢啦个“/”这下应该对了,你试试。

第2个回答  2011-04-03
在index.jsp中改为
<%@ include file="top.jsp" %>

不过,这里推荐使用
<jsp:include page="top.jsp">追问

没有啊 Multiple annotations found at this line:
- Duplicate local variable path
- Duplicate local variable basePath 我按照第一个写的

第3个回答  2011-04-04
%@ include file="<%=request.getContextPath() %>/JSP/top.jsp" %>本回答被提问者采纳