Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes can a servlet run on application server? why not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "can a servlet run on application server? why not?" Watch "can a servlet run on application server? why not?" New topic
Author

can a servlet run on application server? why not?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi everybody,
can anybody tell me why cant we run a servlet on an application server........i mean on middle tier?
thanks in advance.....
surya
------------------
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi surya,
Why can't u run a servlet in aan application server. U can do that. Example (Weblogic server)
Correct me if Iam wrong.
sakthi

Originally posted by suryateja:
Hi everybody,
can anybody tell me why cant we run a servlet on an application server........i mean on middle tier?
thanks in advance.....
surya

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
You can run a servlet there, but then it would no longer be the middle tier, would it? Servlets are usually called by clients. Servlets then call the middle tier, which calls the backend.
There can be a servlet that does business logic of course, in which case it might belong in the middle tier logically.
Originally posted by Sakthivel, Palanivelu:
Hi surya,
Why can't u run a servlet in aan application server. U can do that. Example (Weblogic server)
Correct me if Iam wrong.
sakthi


Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Ok, Tell me what a 3 tier architecture is ?
Browser ---> Buisness logic (Webserver) ----> database server
Ist layer middle layer 3rd layer
U don't need to have seperate application server to say that it is only the middle tier.
But when u talk about n-tier architecture. There u can have any number of buisness components running in any number of application servers.
thanks
sakthi
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
There is a lot of discussion and disagreement about terms like "3-tier system". Many people contend that the pair of browser and webserver are so closely coupled that they form only one "tier". A 3-tier system then becomes:
Front: Browser/Webserver
Middle: Business Logic (eg. a knowledge-based system)
Back: Database
This model works well for servlet development where each servlet becomes a very thin "wrapper" round calls to the business tier and exists just to translate a java object-and-method-call interface to and from a HTTP/HTML/Forms one. The middle tier is then completely independent of the details of the display, and can be used by all sorts of different interfaces, not just a browser.
To answer the original question, servlets can be used at any tier, although they do tend to presuppose the use of HTTP or a very similar protocol. If you wish to use HTTP to communicate between your tiers, rather than RMI/CORBA/JINI etc., then servlets make a good design choice.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can a servlet run on application server? why not?