I have this problem(yellow line) in my jsp file which often caused my eclipse program keep no responding. Although my program can run, but how can i get a rid of this following line of code.
Vector vFieldName = (Vector) session.getAttribute("table_vFieldName_"+TABLE_TYPE);
Vector vTable = session.getAttribute("table_vTable_"+TABLE_TYPE) == null ? new Vector(): (Vector) session.getAttribute("table_vTable_"+TABLE_TYPE);
for (int k=0;k<vTable.size();k++)
{
intSeqNo=vTable.size();
Vector vRow = (Vector) vTable.elementAt(k);
}
I don't think so these warnings would hang your IDE, these are harmless. And also it is always a best practice to specify the type for generics like Vectar<Object>
or Vectar<String>
or List<String>
or ArrayList<String>
etc and not use raw types.
Please read from updated sources and books. It is the era of Java-8 and not Java-1!
Anyways if still you want to get rid of these warnings then:
Select JSP syntax and scroll down to Java as shown:
Click on Error/Warnings as shown
Scroll down to Generic types and select "Ignore" for Usage of raw types
as shown:
Apply, rebuild project and you are done.
Also as a side suggestion, it is better to use ArrayList
or other List
s instead of Vectar
. See this SO answer for why not to use Vectar.
Also avoid using Java code as much as possible in JSPs though sometimes it might be necessary but in most case we can avoid. Use el or jstl instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With