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++)
Vector vRow = (Vector) vTable.elementAt(k);
Best How To :
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
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:
- Right click on your project
- Go to Properties
- Search for "JSP"
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
Lists 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.