how does an application server works?

G

Garg

Hi All,

When i start an server (Lets take tomcat) and i hit a url http://localhost:8080
then what exactly happen at the server end.

which process take that request and how it service that request.

This is a question asked to me in an interview.

Thanks for help in advance.
Tarun
 
G

gaijinco

Hi All,

When i start an server (Lets take tomcat) and i hit a urlhttp://localhost:8080
then what exactly happen at the server end.

which process take that request and how it service that request.

This is a question asked to me in an interview.

Thanks for help in advance.
Tarun

If you hit http then it goes all down to Hyper Text Transfer Protocol,
you should check that one:

http://en.wikipedia.org/wiki/HTTP
 
A

Arved Sandstrom

Garg said:
Hi All,

When i start an server (Lets take tomcat) and i hit a url
http://localhost:8080
then what exactly happen at the server end.

which process take that request and how it service that request.

This is a question asked to me in an interview.

Thanks for help in advance.
Tarun

For a servlet engine I would suggest downloading the servlet specification
and reading that (start at
http://jcp.org/aboutJava/communityprocess/mrel/jsr154/index2.html). I'm
assuming you are not overly concerned with what is going on at the TCP
level.

AHS
 
G

Garg

Hi,

Thanks for your reply.

I think i didn't explain properly.

ok .. let me give an example .. whenever i start tomcat server i find
that tomcat5.exe start running in my system. So when i hit http://localhost:8080/
i assume that tomcat5.exe takes this request and start processing. Now
what I want to understand that once tomcat5.exe gets that request then
what the path tomcat5.exe follows to process the request and what all
process or engines (my terminology is wrong) are involved in this.

I just given an example of Tomcat we can take weblogic, jboss, etc ..

Thanks in advance
Tarun
 
M

Mark Space

Garg said:
Hi,

Thanks for your reply.

I think i didn't explain properly.

ok .. let me give an example .. whenever i start tomcat server i find
that tomcat5.exe start running in my system. So when i hit http://localhost:8080/
i assume that tomcat5.exe takes this request and start processing. Now
what I want to understand that once tomcat5.exe gets that request then
what the path tomcat5.exe follows to process the request and what all
process or engines (my terminology is wrong) are involved in this.

That is a good questions. I think the first thing you need to ask is
which applications are installed on that Tomcat instance, and what do
their config files say they will do?

Since you don't specify a web app, Tomcat goes to .../webapps/ROOT,
looks at that and does....? Yes I'm being lazy, but that should get you
started...

Actually, I think most webapps would be already compiled and loaded into
memory, but lets assume they aren't. So I guess one of the first things
it does is look for a default page, which might be a JSP, and then
compile that before serving it up. If the default page is just a plain
ol' HTML. Hmm, don't forget about any pre-load commands ... then there
are listeners to consider ... it may or may not make a request or
response object if it's being lazy ... owie...
 
A

Arne Vajhøj

Garg said:
ok .. let me give an example .. whenever i start tomcat server i find
that tomcat5.exe start running in my system. So when i hit http://localhost:8080/
i assume that tomcat5.exe takes this request and start processing. Now
what I want to understand that once tomcat5.exe gets that request then
what the path tomcat5.exe follows to process the request and what all
process or engines (my terminology is wrong) are involved in this.

I just given an example of Tomcat we can take weblogic, jboss, etc ..

First of all you need to realize that the Java EE spec specify what
the container does not how it does it. The container implementors
are free to implement the specified functionality how they see fit.

That said then it would be a fair guess that the following is
common:
- they listen on some give ports
- they accept a connection on a port
- the request is dispatched to a thread that processes it
and the API between the container and the web app is given in
the spec, so the container writer has to implement classes that
either extend a class or implement an interface.

There are several open source containers, so you can download
the source from one of them and see examples of how things are
done.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top