Eclipse Warning "List is raw type" in Spring jsp form

For example, I show a very simple Spring form:

<%@ 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> 

However, I get 2 Eclipse warnings:

"The list is a raw type. References to the general type. The list must be parameterized."

They are for the line:

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

Is there a way to get rid of these warnings?

+6
source share
2 answers

I had this problem in Juno. Upgrades prior to Kepler fixed this.

0
source

From: Is there a java @SuppressWarnings equivalent in JSP

Add <%! @SuppressWarnings("rawtypes") %> <%! @SuppressWarnings("rawtypes") %> at the beginning of your JSP to solve the problem.

0
source

Source: https://habr.com/ru/post/953339/


All Articles