• Post Reply Bookmark Topic Watch Topic
  • New Topic

StringOutOfBounds  RSS feed

 
Joey Alencar
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When I do: req.getRequestDispatcher(url).forward(req, res), this exception appears:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
What does it mean?
Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It literally means that a String method such as charAt( n ) has tried to address a position that the String does not have, in this case -1.
Since -1 is returned by String search methods when they don't find a character, I suspect the url string in your call is badly formatted.
Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!