aspose file tools*
The moose likes Servlets and the fly likes sendRedirect does not execute. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "sendRedirect does not execute." Watch "sendRedirect does not execute." New topic
Author

sendRedirect does not execute.

youngsun lee
Greenhorn

Joined: Sep 26, 2003
Posts: 4
To redirect jsp page, i use 'response.sendRedirect(url)'. but this method does not execute. (beside i couldn't meet any excetions.)
i think it may be happened because of using multipart/form-data encoding.

is any help?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

if you are using multipart in the request, you should still be able to use sendRedirect in the response. Is there any possibility that another JSP may be getting included or forwarded to before the call to sendRedirect? An exception could also cause a forward, but you already said you aren't getting any.

Any chance of looking at a code snippet? (only paste the required code, not all of it, and please use UBB code tags)

Dave
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
you need to explicitly return from the service method after the sendRedirect else the redirect will only take effect after the service method has run to completion (which of course may cause a redirect or forward somewhere else replacing the one you want).


42
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sendRedirect does not execute.