• Post Reply Bookmark Topic Watch Topic
  • New Topic

Arrays of Strings problems

 
samart mateo
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got this error message when trying to display the page:

-----------------------------------------------------------------------
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 169 in the jsp file: /A_Report/graphWIP.jsp
Generated servlet error:
Type mismatch: cannot convert from Vector to String[]
-----------------------------------------------------------------------


my line of codes is as below:

-----------------------------------------------------------------------
Vector pjkIDR = new Vector();
pjkIDR.addElement(pjkID);
....
....
String[] lbls = new String [pjkIDR.size()];

for (int j=0; j<pjkIDR.size(); j++){
%><%
String test = (String)pjkIDR.elementAt(j);
lbls[j] = test; <--problem is here!
}
-----------------------------------------------------------------------


plzz help me.
TQ
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope, problem is here:
 
samart mateo
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you correct me?
TQ
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, the problem wasn't there either
That's strange. Are you sure you're looking at the right place ?
Right file ? (graphWIP.jsp)
Right line ? line 169
[ May 15, 2006: Message edited by: Satou kurinosuke ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that you could also use

to copy your vector into a String array.
 
samart mateo
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i found the problem already. it wasnt there
hihi, my mistake. thank you very very very 4 ur help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!