Two Laptop Bag
The moose likes Servlets and the fly likes heres my code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "heres my code" Watch "heres my code" New topic

heres my code

sowmya vasisht

Joined: Oct 17, 2001
Posts: 15
hello deep
thanx for your concern m posting my code here
if you can help me out. i wll be grateful to you
i m calling the servlet from jsp for add, remove and notify images passing vectors to display after adding and removing the elements of a vector the addition is functioning properly but for removal of elements from vector the following excpetion is thrown
ArrayIndexOutOfBoundsException for removeElementAt(index)
plz help me out
here is the jsp

and here is the called servlet which adds remove and notifies thro email

[This message has been edited by Madhav Lakkapragada (edited October 17, 2001).]
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I apologize for not reading all of your code, but I thought I'd ask this question first: Are you looping over a Vector and removing items from it based on (example) 3 checkboxes that a user checks?

If so, make sure you read the following about the removeElementAt(int index) method in the API (pay attention to the second sentence...

As soon as you delete one entry, the other one's are 'renumbered'. It's possible that you will eventually throw an ArrayIndexOutOfBounds exception if you try to remove the second element from the last, if you have already deleted more than 2 elements.
[This message has been edited by Mike Curwen (edited October 17, 2001).]
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

your name doesn't agree with the javaranch guidelines.
please take a moment and re-register after reviewing the
guidelines at
thanks for your cooperation.
- satya
and please use the [ code ] tags (without the spaces)
when posting such huge lines of code. makes it much
easier to read. thanks.

Take a Minute, Donate an Hour, Change a Life
sowmya vasisht

Joined: Oct 17, 2001
Posts: 15
thanx madhav
sowmya vasisht

Joined: Oct 17, 2001
Posts: 15
thanx Mike
I agree. Here's the link:
subject: heres my code
It's not a secret anymore!