JSP引入页面经常出现路径找不到问题
本人今天引入头部文件head.jsp
<%@ include file="${pageContext.request.contextPath}/public/head.jsp" %>
会有小红叉提示
Fragment "/ssim/public/head.jsp" was not found at expected path /ssim/src/main/webapp/ssim/
public/head.jsp
正确路径应该是
<%@ include file="/public/head.jsp" %>
还有一种错误
用java编程程序运行后出现/1.jsp(9,41) attribute for %>" is not properly terminated 原因是什么呢
标签的page属性值可以是相对路径URL或者<%=表达式 %>,但同时只能存在其中一种
jsp页面加<base href="<%=basePath%>">
只要删除<base href="<%=basePath%>"> 这个就好了,页面也不引用它,但是只要在页面加<base href="<%=basePath%>">就是不显示
关于引入页面
我们都知道在jsp中include有两种形式,分别是
<%@ include file=” ”%>
<jsp:include page=” ” flush=”true”/>
<%@ include file=” ”%>
<jsp:include page=” ” flush=”true”/>
区别:
http://java.chinaitlab.com/ServletJsp/529740_2.html