File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

heres my code

 
sowmya vasisht
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5040
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

"aishwarya"
your name doesn't agree with the javaranch guidelines.
please take a moment and re-register after reviewing the
guidelines at http://www.javaranch.com/name.jsp
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.
 
sowmya vasisht
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx madhav
 
sowmya vasisht
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx Mike
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic