【发布时间】:2014-11-13 08:24:31
【问题描述】:
我所拥有的任何地方:
<img alt="image" src="<%=request.getContextPath()%>/images/image.png" >
NetBeans 报错:
Bad value " /images/image.png" for attribute "src" on element "img": WHITESPACE in PATH.
Syntax of IRI reference:
Any URL. For example: '/hello', '#canvas', or 'http://example.org/'. Characters should be represented in NFC and spaces should be escaped as '%20'.
From line 42, column 21; to line 42, column 64
(Rule Category: Attributes)
我怎样才能摆脱它?
【问题讨论】:
-
不要在 JSP 文件中使用 Java 代码。使用 JSTL。
${pageContext.servletContext.contextPath}
标签: java jsp jakarta-ee netbeans el