Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

use RequestDispatcher forward to error page  RSS feed

 
David Qiu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i wonder how to use a RequestDispatcher to forward the request to an error page? i forward the request to a servlet which use sendError() to send an error back. But the second servlet doesn't work. And i heard there is something should be specified in teh deployment descriptor file. your help is greatly appreciated
regards
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about forwarding directly to the error.jsp page? Make sure you are not outputting anything before attempting a forward.

Another option, what about using an include? This will go out the specified resource, and it will then return to the calling resource (the one doing the include).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!