Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Vector not accesible in JSP

 
dr priti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to JSP. I have a vector from which I can retrive values if I am using it as an Java file. Now I want to use that file in JSP. So Ihave removed the main method and compiled it and kept in classes folder of Javawebserver. I am using useBean in JSP. But as I call add method of Vector It giving me following error
"java.lang.NoSuchMethodError: java.util.Vector: method add(ILjava/lang/Object V not found"
Why Vector's method are not recognised in JSP. Thanx in advance.
 
Brian Nice
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have at the beginning of your JSP page the import for java.util.* ?
<%@ page language="java" import="java.util.*" %>
Brian
 
Angela Lamb
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It isn't Vector that's inaccessible, it's the method add(Object). That method wasn't added until version 1.2 and you are probably using an earlier version.
 
dr priti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Nice:
Do you have at the beginning of your JSP page the import for java.util.* ?
<%@ page language="java" import="java.util.*" %>
Brian

Hi Brian,
Thanx for reply. I have already added the tag suugested by you, but still I am getting the error as
"Method add(java.lang.String) not found in class java.util.Vector." Tell me how to go about it
 
dr priti
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Angela Ann:
It isn't Vector that's inaccessible, it's the method add(Object). That method wasn't added until version 1.2 and you are probably using an earlier version.

Hi Angela,
I am using JDK 1.3, still the error is there. I have tested the fuction as application which is working fine but same is not working in JSP.
 
Arun, Shanmugham
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi priti,
I have coded the vector add method in JSP for our project , It is working fine. Can u send ur part of code, so i can find the bug.
Regards
Arun
 
Raja Shekhar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
if u wanna put the value in VECTOR
just use..
Vector v=new Vector();
v.addElement("Samplehere")
if u wanna retrive the element just use..
v.elementAt(0);
Hope this will defi help..FReshy
bye



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic