【问题标题】:Eclipse Warning “List is a raw type” in a Spring jsp formSpring jsp 表单中的 Eclipse 警告“列表是原始类型”
【发布时间】:2013-09-10 18:54:52
【问题描述】:

例如我展示了一个非常简单的 Spring 表单:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page session="false" %>
<form:form id="form" method="post" modelAttribute="formBean" cssClass="cleanform">
<fieldset>
    <legend>Personal Info</legend>
    <form:label path="name">
                Name <form:errors path="name" cssClass="error" />
    </form:label>
</fieldset>
</form:form>

我仍然收到 2 个 Eclipse 警告:

“List 是原始类型。对泛型类型 List 的引用应该被参数化”

他们是为了这条线:

Name <form:errors path="name" cssClass="error" />

有什么办法可以消除这些警告吗?

【问题讨论】:

标签: eclipse spring jsp jsp-tags


【解决方案1】:

发件人:Is there an equivalent to java @SuppressWarnings in JSP

&lt;%! @SuppressWarnings("rawtypes") %&gt; 添加到JSP 的顶部应该可以解决问题。

【讨论】:

    【解决方案2】:

    我在朱诺遇到了这个问题。升级到 Kepler 解决了这个问题。

    【讨论】:

    • 升级到开普勒并没有解决这个问题。
    猜你喜欢
    • 2012-01-19
    • 2015-10-12
    • 1970-01-01
    • 2012-08-06
    • 2018-10-16
    • 2011-02-05
    • 1970-01-01
    • 2012-11-07
    • 1970-01-01
    相关资源
    最近更新 更多