@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  resp.setContentType("text/plain");
  PrintWriter sendToClient=resp.getWriter();
  for (  Video v : this.videos) {
    sendToClient.write(v.getName() + " : " + v.getUrl()+ "\n");
  }
}

@ Override protected void doGet ( HttpServletRequest req , HttpServletResponse resp ) throws ServletException , IOException { resp . setContentType ( "text/plain" ) ; PrintWriter sendToClient = resp . getWriter ( ) ; for ( Video v : this . videos ) { sendToClient . write ( v . getName ( ) + " : " + v . getUrl ( ) + "\n" ) ; } }
this method processes all of the http get requests routed to the servlet by the web container . this method loops through the lists of videos that have been sent to it and generates a plain / text list of the videos that is sent back to the client .
