I has one doubt regarding the RequestDispatcher class. My doubt, is in our project I am calling a jsp from a servlet. I am including the content of jsp in servlet using RequestDispatcher.include method. The jsp content is getting into the servlet but the problem is in displaying the content.
what I want to know is when we forward/include does the page gets refreshed or not.
Any Help is appreciated.
Thanks & Regards,
Requestdispatcher forwards/include will refresh the screen. If you are looking for ajax kind of thing you need to look for ajax library support.
include will simply add the response of the included JSP to the current response stream. It doesn't have anything to do with refresh.
Refresh depends on how you raised your request. If it was a synchronous browser submit ( including form.submit() or changing the frame.src using js ) then the page will refresh.
If it is an asynchronous ajax request, then the page will not refresh.