Back to Browse

Servlets Tutorial 17-For Beginners| RequestDispatcher| SendRedirect | Include Vs Forward | In Hindi

11.3K views
Mar 18, 2018
27:19

(Calling A resource from a Servlet):- Resource:-could be html,servlet,jsp ServletCollebratation(ServletChaning):- It is the process of calling one servlet from an other servlet. There are two ways are used to performed the servlet collaboration:- 1)-By Request Despatcher Interface. 2)-SendRedirect() method of HttpServletRsponse. By Request Despatcher:- It is an interface whose Implementation is providing by Different –Different venders accordingly. An Object of Implementing class of this interface is responsible to include or forward the request to the any resource(html,servlet,jsp) This Interface Having Two fallowing Methods For This:- public void include(ServlerRequest req , ServletResponse res) public void forward(ServlerRequest req,ServletResponse res) How to get the Object of (Implementing class of This Interface) Request Dispatcher:- By Calling RequestDispatcher rd=request.getRequestDispatcher("name of resource"); Different between include and forward:- forward:- In case of forward method final response is providing by called resource. include method:- In this case final response is proving by called an calling response both. Point Remember About Request Dispatcher:- 1)-It never generate new Request and new Response keeps same request and response. 2)-You can’t call the any resource outside context(server) in case of Request Dispatcher. 3)-URL will not changed, It will be same. SendRedirect Method:- It is the method of HttpServletRespone Interface.And Using This Method we can only forward the response from servlet to any resource. Public void sendRedirect(“Forword Resource URL”) Pont About Send Redirect:- 1)-It always generate new request and new response. 2)-URL will be changed always. 3)-You can go from Outside Context Using Send Redirect. Stay tuned with me for more upcoming Videos, don't forget to subscribe my YouTube Channel and share your valuable comments in Comment section down below, i'll be happy t o help you all, your Surya ☺ Eclipse Download Url- http://www.eclipse.org/downloads/ Apache Tomcat Url- https://tomcat.apache.org/download-80.cgi Servlet Interface Methods of Servlet interface There are 5 methods in Servlet interface. The init, service and destroy are the life cycle methods of servlet. These are invoked by the web container. 1. public void init(ServletConfig config) 2. public void service(ServletRequest request,ServletResponse response) 3. public void destroy() 4. public ServletConfig getServletConfig() 5. public String getServletInfo() Download my you tube channel Android application from here- https://www.dropbox.com/s/stoehcarylm... Firebase Tutorial No-6 URl- https://www.youtube.com/watch?v=5IWBz... Firebase Tutorial No-1 URl- https://www.youtube.com/watch?v=gf0VQ... Firebase Tutorial No-2 URl- https://www.youtube.com/watch?v=srgAL... Firebase Tutorial No-3 URl- https://www.youtube.com/watch?v=TW0uO... Firebase Tutorial No-4 URl- https://www.youtube.com/watch?v=XXxRA... Write program url using Firebase Database- https://www.dropbox.com/s/wxggu30ajqa... Sqlite database tutorials part-1 url- https://www.youtube.com/watch?v=6a9lI... Sqlite database tutorials part-2 url- https://www.youtube.com/watch?v=h1Peq... Storage option url- https://www.youtube.com/watch?v=KgCfx... Internal Storage url- https://www.youtube.com/watch?v=O-VKJ... External Storage url- https://www.youtube.com/watch?v=EteGm... Shared Prefrences url- https://www.youtube.com/watch?v=KZJC2... Spinner Url- https://www.youtube.com/watch?v=o3KZz... CustomListView Url- https://www.youtube.com/watch?v=2geTp... ListView In Android Studio Part-1 https://www.youtube.com/watch?v=taItn... ListView In Android Studio Part-1 ListView In Android Studio Part-2 With EventHandling https://www.youtube.com/watch?v=F3tsW... ListView In Android Studio Part-3 With EventHandling https://www.youtube.com/watch?v=fCh5D... Firebase:- https://www.youtube.com/watch?v=Lncmj... How to Install Java Url- https://www.youtube.com/watch?v=NXlHE... Download my you tube channel Android application from here- https://www.dropbox.com/s/stoehcarylm... GridLayout url- https://www.youtube.com/watch?v=B3TUS... TableLayout url- https://www.youtube.com/watch?v=wbV3t... RelativeLayout- https://www.youtube.com/watch?v=80Kk_... https://www.youtube.com/watch?v=1jnNF... Linearlayout- https://www.youtube.com/watch?v=yY3xL... https://www.youtube.com/watch?v=vnEdL... Connect on Socials:- Facebook:- https://www.facebook.com/AndroJavaTec... Twitter:- https://twitter.com/AndroJavaTech4U Google Plus:- https://plus.google.com/u/0/+AndroJav... LinkedIn:- https://www.linkedin.com/in/androjava...

Download

0 formats

No download links available.

Servlets Tutorial 17-For Beginners| RequestDispatcher| SendRedirect | Include Vs Forward | In Hindi | NatokHD