
Pls guide about how to write the web.xml file to deploy our web applications that uses JSP, by using tomcat...



Hi, Here is the code of web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">; </web-app> Save the web.xml file into WEB-INF directory. You can declare your servlet into web.xml file. <!-- Hello World Servlet --> <servlet> <servlet-name>HelloServlet</servlet-name> <servlet-class>HelloWorld</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>HelloServlet</servlet-name> <url-pattern>/Hello</url-pattern> </servlet-mapping> To access the servlet you have to type http://localhost:8080/test/Hello into browser. Thanks