aspose file tools
The moose likes Servlets and the fly likes Problem forwarding a request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem forwarding a request" Watch "Problem forwarding a request" New topic

Problem forwarding a request

Umberto Fabbrucci

Joined: Aug 30, 2004
Posts: 6
Hi all, I have a problem with a servlet forwarding a client's request
The code in my servlet is the following:

For some users I get an exception when trying to forward:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
The weird fact is that the forward inside my catch block works fine!

I'm using Weblogic 5.1 and jdk 1.4

Thank you.

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300

I have never been able to get a forward to work without adding a / before the page.

You may need to supply more than just the page name as this will look at the root of your context.
[ September 24, 2004: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
It is sorta covered in the JavaRanch Style Guide.
subject: Problem forwarding a request