DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=28058>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28058 JspRuntimeLibrary.getContextRelativePath() can throw StringIndexOutOfBoundsException Summary: JspRuntimeLibrary.getContextRelativePath() can throw StringIndexOutOfBoundsException Product: Tomcat 5 Version: 5.0.19 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: Jasper AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] A program I am working on is throwing an exception java.lang.StringIndexOutOfBoundsException: String index out of range: -1 from within org.apache.jasper.runtime.JspRuntimeLibrary.getContextRelativePath (JspRuntimeLibrary.java:963) According to the docs http://jakarta.apache.org/tomcat/tomcat-5.0- doc/servletapi/javax/servlet/http/HttpServletRequest.html#getServletPath(), getServletPath() can return an empty string which is what is happening in my app. The line in question: uri.substring(0, uri.lastIndexOf('/')) + '/' + relativePath where uri is an empty string is what is causing this exception to be thrown. As you can see uri.lastIndexOf is going to return -1 and uri.substring(0, -1) just does not work. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]