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                                                                          ...

example of sendRedirect method in servlet

Question : example of sendRedirect method in servlet

Ans : we are redirecting the request to the google server. Notice that sendRedirect method works at client side, that is why we can our request to anywhere. We can send our request within and outside the server.


NormServlet.java
1.     import java.io.*;  
2.     import javax.servlet.*;  
3.     import javax.servlet.http.*;  
4.       
5.     public class NormServlet extends HttpServlet{  
6.     public void doGet(HttpServletRequest req,HttpServletResponse res)  
7.     throws ServletException,IOException  
8.     {  
9.     res.setContentType("text/html");  
10.   PrintWriter pw=res.getWriter();  
11.     
12.   response.sendRedirect("http://www.google.com");  
13.     
14.   pw.close();  
}} 


If you want to donate money if this information is useful to 
you :

                       
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