This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet RequestDispatcher Problem  RSS feed

brajendra mishra
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am beginer having a servlet code:
RequestDispatcher rd=application.getRequestDispatcher("/RequestDisTwo");
is working fine.
but instead of include if i am writing :
getting Exception:

javax.servlet.ServletException: Servlet execution threw an exception

root cause

java.lang.NoSuchMethodError: javax.servlet.ServletResponse.resetBuffer()V

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
can anybody help me.
David O'Meara
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I havr the feeling there are two things going on here.

Firstly, 'forward' requires all of the response to come from the forward resource. If anything has already been sent to the client and is buffered, the buffer gets cleared first. If the buffer cannot be cleared, an Exception is thrown. This is the initial problem you should solve: make sure nothing is getting sent.

When clearing the buffer, javax.servlet.ServletResponse.resetBuffer() is called. If you check the API, this method has been in the Servlet spec since version 2.3, and Servlets 2.3 have been supported since Tomcat 4.1.36

This is the second issue, and I have the feeling you have an incorrect jee or Servlet JAR on your file system somewhere...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!