File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Error on page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Error on page" Watch "Error on page" New topic

Error on page

Jherald Lacambra
Ranch Hand

Joined: Feb 02, 2005
Posts: 129
Cant figure out the error may be you could help me?

java.lang.StringIndexOutOfBoundsException: String index out of range: 5
at java.lang.String.substring(
at FileSize.CheckFileSize.round(
at FileSize.CheckFileSize.dispSize(
at _addproduct._jspService(
at com.orionserver.http.OrionHttpJspPage.service(
at oracle.jsp.runtimev2.JspPageTable.service(
at oracle.jsp.runtimev2.JspServlet.internalService(
at oracle.jsp.runtimev2.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at com.evermind.server.http.ResourceFilterChain.doFilter(
at com.evermind.server.http.ServletRequestDispatcher.invoke(
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(
at com.evermind.server.http.HttpRequestHandler.processRequest(

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32818

According to the message, you are calling substring on a string that is too short. Try outputing the string (and commenting out the substring call) to see what is getting passed. Better yet, add an if statement to check the length before calling substring.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Don't get me started about those stupid light bulbs.
subject: Error on page
It's not a secret anymore!