jaffar
jaffar

Reputation: 671

How can I run a servlet programme?

How can I run a servlet programme?How can i set the classpath?

Upvotes: 0

Views: 248

Answers (3)

Rahel Lüthy
Rahel Lüthy

Reputation: 7007

just to repeat the basics: a servlet is a piece of java code that runs inside a servlet container (i.e. a spezialized web server). it listens to client requests (typically issued through a web browser) and answers them with a response (e.g. with an HTML page).

"running" a servlet can thus mean two different things:

  1. deploying the servlet to a servlet container (and thereby making it listen to requests), or
  2. actually making it process a client request

(1) is achieved by packaging the servlet code (+ 3rd party libraries) into a war file and deploying this web application archive to the server -- details may vary depending on the type of servlet container. (2) is triggered by issuing a http request, e.g. through typing the servlet URL (something like http://localhost:8080/servletexample) into the location bar of your browser.

Upvotes: 0

Bhushan Bhangale
Bhushan Bhangale

Reputation: 10987

Please read this http://www.jsptube.com/servlet-tutorials/simple-servlet-example.html for your first steps.

Upvotes: 2

paxdiablo
paxdiablo

Reputation: 881103

Well, you generally run it in a servlet container such as Websphere Application Server or Tomcat. And the way you configure the classpath depends on the servlet container you choose.

Upvotes: 0

Related Questions