Sunday, August 24, 2008


How to run a servlet program:

We know concepts of a servlet programs,but the difficulty which we all face is process executing .Here i have explained how to execute the program

Steps:

Compilation:

*Type the program in the notepad.

*save it as a java file in the format .java

*Then in the command prompt normal java compilation is carried the only thing we have to add is class path.

Example:let sample.java be our servlet program.

*Command to be typed in the command prompt is javac sample.java -classpath "c:/ProgramFiles/Apache group/tomcat4.1(any version that you have installed)/common/lib/servlet.jar"

*Thus a class file is created.

*Now copy this class file and paste it inside the "c:/ProgramFiles/Apache group/tomcat4.1/webapps/examples/webinf/classes.

Thus compilation over.

Execution:

*Run the tomcat type in the address tab as http://localhost:8080/examples/servlet/sample

Now u can see the output.

1 comments:

Anonymous said...

I tried this.. Yes its really very easy.......

Post a Comment