Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sendRedirect does not execute.

 
youngsun lee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic