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
Joined: Nov 02, 2000
Posts: 195
posted
0
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
Joined: Feb 22, 2001
Posts: 156
posted
0
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
Joined: Mar 05, 2001
Posts: 18
posted
0
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
Joined: Mar 05, 2001
Posts: 18
posted
0
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
Joined: Apr 05, 2001
Posts: 34
posted
0
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
Sun Certified Programmer for Java2 Platform
Raja Shekhar
Ranch Hand
Joined: Apr 02, 2001
Posts: 49
posted
0
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
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.