Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to run a servlet program?

Answers were Sorted based on User's Feedback



How to run a servlet program?..

Answer / subrahmanyam

We have to Make a WEB-INF folder and under it classes
folder. In WEB-INF we have to write web.xml .

Our compled servelet class file should be stored in classes
folder.

Make a war file using jar & deploy in Web.

Is This Answer Correct ?    97 Yes 27 No

How to run a servlet program?..

Answer / anji

The structure of the web app. is
demo[root]
- all jsps will go her
- WEB-INF
- web.xml
- tld files
- classes
- all java class files will go here

Compile all the files and create a war file
copy the war file into Tomcat_root\webapps folder
if you use weblogic or webspehere the deployment will be
different.

Is This Answer Correct ?    41 Yes 28 No

How to run a servlet program?..

Answer / suresh

we have make dir name is,WEB-INF is the root directory
WEB-INF
--classes dir
--lib dir
--src dir
--web.xml
-html file
-dhtml file
-jsp file

lib dir contains
--jasper-runtime.jar
--servlet-api.jar
--jsp-api.jar

your source code put in the src dir

--put the WEB-INF dir in your tomcat server and run the servlet

Is This Answer Correct ?    27 Yes 15 No

How to run a servlet program?..

Answer / kunal sagar

first we con compile the java code throught javac compiler.
then,its .class file will be created that .class file copy
and paste the in the directory
c:/program files/apache/tomcat/webapps/servlet/web-inf
/classes.
then back one step backward
change the servlet code with ur file name
and also sevlet mapping code with ur file name
save that file
then open explorar
and type the local host address

Is This Answer Correct ?    18 Yes 6 No

How to run a servlet program?..

Answer / vivek

To run a servlet one should follow the steps illustrated below:

Download and Install the tomcat server: Install the tomcat server in a directory in which you want to install and set the classpath.for the variable JAVA_HOME in the environment variable. To get details about the installation process and setting the classpath click the link Tomcat installation.


Set the class for the jar file: Set the classpath of the servlet-api.jar file in the variable CLASSPATH inside the environment variable by using the following steps.

For Windows XP,
Go to Start->Control Panel->System->Advanced->Environment Variables->New button and Set the values as
Variable Name: CLASSPATH
Variable Value: C:\Program Files\Java\Tomcat 6.0\lib\servlet-api.jar

For Windows 2000 and NT

Go to Start->Settings->Control Panel->System->Environment Variables->New button and Set the values as
Variable Name: CLASSPATH
Variable Value: C:\Program Files\Java\Tomcat 6.0\lib\servlet-api.jar

Create a java source file and a web.xml file in a directory structure.
Compile the java source file, put the compiled file (.class file) in the classes folder of your application and deploy the directory of your application in the webapps folder inside the tomcat directory.
Start the tomcat server, open a browser window and type the URL http://localhost:8080/directory (folder name of your application) name/servler name and press enter.

If everything is correct your servlet will run.

Is This Answer Correct ?    8 Yes 5 No

How to run a servlet program?..

Answer / anil reddy

WEB-INF
--classes dir(.class)
--lib dir
--src dir(.java)
--web.xml
-html file
-dhtml file
-jsp file
=>tomcat on and goto browser type your html name(http:
\\localhost:8081\.html)

Is This Answer Correct ?    10 Yes 10 No

How to run a servlet program?..

Answer / giridhar gangapatnam

Sampleapplication
-- any html or jsp pages
-- WEB-INF
--web.xml
--lib(which contains any jar files)
--classes
--(all Servlet .class files)


After compilation of Servlet .java files start the Tomcat
Server and in URL type like:
http://localhost:8080/Sampleapplication/.html(or).jsp <--(enter)

Is This Answer Correct ?    5 Yes 6 No

Post New Answer

More Servlets Interview Questions

Explain the difference between servletconfig and servletcontext in servlet?

0 Answers  


What is servlet context ?

4 Answers  


Hi............ When i am started the tomcat server it started. but it not load the jar files wht we deploving file.suppose we load the wapp folder in webapps. At running time it show the below error in tomcat server INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.0\web apps\wapp\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, s ection 9.7.2. Offending class: javax/servlet/Servlet.class How to slove this problem in my system. plz give answer for this problem.

5 Answers  


What do you mean by web applications?

0 Answers  


What do you mean by mime type?

0 Answers  


If you want to modify the servlet,will the Webserver need to be ShutDown ?

9 Answers  


Why is servlet used?

0 Answers  


What is servlet in tomcat?

0 Answers  


What are the mechanisms used by a servlet container for maintaining session information?

0 Answers  


What’s the difference between forward() and sendredirect() methods?

0 Answers  


What is session tracking?

0 Answers  


What is load-on-startup in servlet?

0 Answers  


Categories