Professional Documents
Culture Documents
C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps
C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps
give as /servletname/*
In html form action="servletname" method="get or post" create dsn in system dsn in sql server or any database you have To compile the servlet set the java path set the classpath in cmd prompt
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\s2s\WEBINF\classes>set classpath=C:/Program Files/Apache Software Foundation/Tomcat 5.5/common/lib/servlet-api.jar; press enter javac servletname.java go to Browser http://localhost:8084/ 1.click manager give user and password if u donot know go to tomcat install.directory/ conf/tomcat-users.xml u find there 2.click the project of yours and enjoy running servlet.
STEP-2 How to Make your first java web Application go Inside Webapps Folder and copy the Root Folder(it is default web application) copy it and paste it in webapps folder,its will create folder copy of Root folder Rename it (eg- F2 Key) and type name delhi . Go inside delhi and delete all files and images except WEB-INF folder.
Go Inside WEB-INF Folder, it Contains only web.xml file ,create folder named classes (no capital letter & no spaces) Copy your Helloworld.class file in this classes Folder. STEP-3 Open web.xml in any Editor (eg- Notepad or EditPlus) and Type the Following Code inside <web-app></web-app>Tag. <servlet> <servlet-name>HelloWorld</servlet-name> <servlet-class>HelloWorld</servlet-class> </servlet> <servlet-mapping> <servlet-name>HelloWorld</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> your web.xml Should Looks as Screen Shown below.