你能告诉我为什么分析器a href = ссылка对jsp文件中的链接()的值给出警告吗?例如:
<c:forEach items="${items}" var="item">
<jsp:useBean id="item" type="entity.Item"/>
<tr>
<td><a href="item?id=${item.id}&action=view">${item.title}</a></td>
<td><%=CurrencyFormat.format(item.getPrice())%></td>
<c:if test="${role == 'admin'}">
<td>${item.amount}</td>
<td><a href="item?id=${item.id}&action=delete">Delete</a></td>
<td><a href="item?id=${item.id}&action=edit">Edit</a></td>
</c:if>
<c:if test="${role == 'user'}">
<td><a href="item?id=${item.id}&action=buy">Buy</a></td>
</c:if>
</tr>
</c:forEach>
<a href="item?id...在这里,该词在线条中带有下划线item并发出警告Cannot resolve file 'item'。应用程序编译并成功运行。如何在不禁用或抑制检查的情况下解决警告?
要删除此警告,您需要将 servlet 映射到
web.xml. 例如,如果写入以下内容,则此代码<a href="items">Webstore</a>将不包含错误(该单词items没有被分析器下划线) :web.xml当然,您也可以使用注解进行映射,
@WebServlet("/items")而不是web.xml: