Skip to main content

Featured

Game Development Tutorials In Android

Game Development Tutorials In Android Hi Guys,                 We are shortly started Game Development Tutorials in Android Studio. So everyone supports me and share this blogs to your friends. Guys, At this time everyone is freely available to source code and we are provide a video for step by step game developments. you are learn free and feel free to support us. Guys, if you have any question to me, so feel free to comment us. I will try to answer all the question as long as possible.                                                     Thank's                                                                          ...

SendRedirect method in servlet

Question :  SendRedirect in servlet
Ans : The sendRedirect() method of HttpServletResponseinterface can be used to redirect response to another resource, it may be servlet, jsp or html file.
It accepts relative as well as absolute URL.
It works at client side because it uses the url bar of the browser to make another request. So, it can work inside and outside the server.



Question : Difference between forward() and sendRedirect() method

Ans: There are many differences between the forward() method of RequestDispatcher and sendRedirect() method of HttpServletResponse interface. They are given below:

forward() method
sendRedirect() method
The forward() method works at server side.
The sendRedirect() method works at client side.
It sends the same request and response objects to another servlet.
It always sends a new request.
It can work within the server only.
It can be used within and outside the server.
Example: request.getRequestDispacher("servlet2").forward(request,response);
Example: response.sendRedirect("servlet2");

Syntax of sendRedirect() method

1.     public void sendRedirect(String URL)throws IOException;  

If this information is important to you , and you want to , I will continue writing some more details of programming language, so click on the advertising, available on this page. This is motivate me for writing some more blogs.

Comments