jsp - Vector : References to generic type Vector<E> should be parameterized -
i have problem(yellow line) in jsp file caused eclipse program keep no responding. although program can run, how can rid of 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); (int k=0;k<vtable.size();k++) { intseqno=vtable.size(); vector vrow = (vector) vtable.elementat(k); }
i don't think these warnings hang ide, these harmless. , best practice specify type generics vectar<object>
or vectar<string>
or list<string>
or arraylist<string>
etc , not use raw types.
please read updated sources , books. era of java-8 , not java-1!
anyways if still want rid of these warnings then:
- right click on project
- go properties
- search "jsp"
select jsp syntax , scroll down java shown:
click on error/warnings shown
scroll down generic types , select "ignore"
usage of raw types
shown:apply, rebuild project , done.
also side suggestion, better use arraylist
or other list
s instead of vectar
. see this answer why not use vectar.
also avoid using java code as possible in jsps though might necessary in case can avoid. use el or jstl instead.
Comments
Post a Comment