wood burning stoves 2.0*
The moose likes Servlets and the fly likes Vector not accesible in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Vector not accesible in JSP" Watch "Vector not accesible in JSP" New topic
Author

Vector not accesible in JSP

dr priti
Greenhorn

Joined: Mar 05, 2001
Posts: 18
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
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
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
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
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
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
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



 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Vector not accesible in JSP
 
Similar Threads
Why can't I get the Vector value in jsp(ModalDialog)?
performance issue of Vector
Vector object in HttpServletRequest
JSP MySql
Having trouble getting Vector out of a bean in JSP