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 protected method in java source code

Question : What is written inside the protected service method?

Ans : The protected service method checks the type of request, if request type is get, it calls doGet method, if request type is post, it calls doPost method, so on. Let's see the internal code:
1.     protected void service(HttpServletRequest req, HttpServletResponse resp)  
2.             throws ServletException, IOException  
3.         {  
4.             String method = req.getMethod();  
5.             if(method.equals("GET"))  
6.             {  
7.                 long lastModified = getLastModified(req);  
8.                 if(lastModified == -1L)  
9.                 {  
10.                   doGet(req, resp);  
11.               }   
12.       ....  
13.       //rest of the code  
14.           }  
15.       }  

Comments