I would like to know what happens to the html codes written inside the servlet? What is the need of writing like this?
Sample code:
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException
{   
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Using GET Method to Read Form Data";
    out.println("<html>"<head><title>"Welcome"</title></head>\n" +
                "<body><p>Welcome to servlet</p></body></html>");
}
 
     
     
     
    