Q)How many names does a servlet have in a web application? =>Every servlet has 3 names. 1)registration name 2)class name 3)public URL name Q)What is the purpose of tag in web.xml? =>to register a servlet with the servlet container. Q)What is the purpose of tag? =>to give public URL name to the servlet. Note:- We can give any URL name to a servlet. But it should precede with "/". =>In the previous application, registration name of the servlet:one class name:HelloWorldServlet public URL name:/hello Q)Modify HelloWorldServlet so as to produce a web page for the client. import javax.servlet.*; import java.io.*; public class HelloWorldServlet extends GenericServlet { public void service(ServletRequest request,ServletResponse response)throws ServletException,IOException { response.setContentType("text/html"); PrintWriter printWriter=response.getWriter(); printWriter.println(""); printWriter.println(""); printWriter.println("

Hello ! Web World

"); printWriter.println(""); printWriter.println(""); printWriter.close(); } }