question on servlets

do we require both a web container and web server on my computer to test and run servlets?

is tomcat also a server? because as far as I know it's just a container and not a web server.

and also I have another question

in addition to the tomcat running at the background of the computer do I need to run a web server also at the background, so that I can run and test my servlets or is tomcat only enought to run servlets on the my computer?

[466 byte] By [psychica] at [2007-11-27 5:23:43]
# 1
http://www.unix.org.ua/orelly/java-ent/servlet/index.htm
suparenoa at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 2
If memory serves, Tomkat includes both a web server component and an application server component. The web server would I think be the Apache Web Server. At least I've never had a problem running servlets on a Tomkat server.PS.
puckstopper31a at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 3
Tomcat alone is enough to host servlets. The terms "server" and "container" here are interchangeable
georgemca at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 4

> If memory serves, Tomkat includes both a web server

> component and an application server component. The

> web server would I think be the Apache Web Server. At

> least I've never had a problem running servlets on a

> Tomkat server.

>

> PS.

Tomcat is a web server. Or at least, part of it is. It doesn't use the Apache httpd, it's entirely written in Java. You can use Apache httpd as your web server in front of Tomcat, if you like, using a [url=http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/]connector[/url]

georgemca at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 5
> Tomcat alone is enough to host servlets. The terms> "server" and "container" here are interchangeableyou mean tomcat is both a web server as well as a container
psychica at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 6

> > Tomcat alone is enough to host servlets. The terms

> > "server" and "container" here are interchangeable

>

> you mean tomcat is both a web server as well as a

> container

I mean that "container" doesn't really mean anything here. What would a web container that didn't serve it's content actually do?

georgemca at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 7
I never came accross a servlet engine which doesn't handle fixed pages.The main reason people tend to front it with apache for the fixed pages is that, to listen on the default http port a program has to run as root, which you don't want a servlet engine to do.
malcolmmca at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 8

> > > Tomcat alone is enough to host servlets. The

> terms

> > > "server" and "container" here are

> interchangeable

> >

> > you mean tomcat is both a web server as well as a

> > container

>

> I mean that "container" doesn't really mean anything

> here. What would a web container that didn't serve

> it's content actually do?

is it always that if someone would has a java server, would they have a web server which is also a container, as in tomcats case you specified here.

and also can i run a specific web server and make tomcat run only as a container and not a web server.

psychica at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 9

> > > > Tomcat alone is enough to host servlets. The

> > terms

> > > > "server" and "container" here are

> > interchangeable

> > >

> > > you mean tomcat is both a web server as well as

> a

> > > container

> >

> > I mean that "container" doesn't really mean

> anything

> > here. What would a web container that didn't serve

> > it's content actually do?

>

> is it always that if someone would has a java server,

> would they have a web server which is also a

> container, as in tomcats case you specified here.

The terms "server" and "container" are interchangeable here

> and also can i run a specific web server and make

> tomcat run only as a container and not a web server.

Forget that you ever heard the word "container". It's confusing you. It is possible to front-end a servlet engine with another web server, but it's not always necessary, and it certainly would be the wrong thing to do during development

georgemca at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 10

thank you so much for replying. I am really confused here. i searched for container and web server definition. it says container is necessary to run servlets as it provides environment to run servlets and web server delegates the requests to the container which then runs the servlets and then the provides the output. it also says that tomcat is a container. i got all these from wiki

i am really confused if tomcat is web server

and also what is required to run servlets? is it a web server?

psychica at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 11

> thank you so much for replying. I am really confused

> here. i searched for container and web server

> definition. it says container is necessary to run

> servlets as it provides environment to run servlets

> and web server delegates the requests to the

> container which then runs the servlets and then the

> provides the output. it also says that tomcat is a

> container. i got all these from wiki

>

>

> i am really confused if tomcat is web server

>

> and also what is required to run servlets? is it a

> web server?

Like I said, forget you ever heard the word "container" - it's confusing you

A web server delivers content over the HTTP protocol, period. If a piece of kit does that, it's a web server. Tomcat does that, ergo, it's a web server. A servlet engine is required to run servlets, but since that's not much use on it's own, most (I say most because although I can't think of one, someone is bound to present a servlet engine that isn't a web server) servlet engines are also web servers. The word "container" is just sometimes used in place of other terms, it doesn't offer a new meaning

georgemca at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...
# 12
Oh. thank you so much. i don't think i could have got a better explanation for this from any tutorial or notes on the net which only managed to confuse me. thank you again.
psychica at 2007-7-12 11:49:41 > top of Java-index,Java Essentials,Java Programming...