Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

StringOutOfBounds  RSS feed

 
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.
 
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
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!