如下一行代码,其中src = "<%=path%>"/html/images/logo.png,为何用了个path,然后为何编译的时候path是错的?
<img id="logo-img" src="<%=path%>/html/images/logo.png" width="617" height="65" />
------解决方案--------------------
页面上面没有下面这段?
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
------解决方案--------------------
你的页面引入其他页面了,其他页面里面有1楼写的那个path。
------解决方案--------------------
应该是要获取绝对路径吧!