• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding WAR & EAR

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I remember that in many J2EE applications, we have a web server, app server and DB call finally.
I have a set of questions here...
1. Why do we need 2 servers on the first hand?
2. What is the difference between a web server and an app server?
3. What is the exact flow of request and response in such a case?
4. Where is the WAR deployed and where is the EAR deployed (in web server or appserver)?

It will be of great help if somebody can give be a step by step explanation of these 4 questions.

Thanks.

Regards,
Ram
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once you get the answers to these questions, you can then be a Java Architect on your resume.

Good luck!
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am going to give this a try.

1. Why do we need 2 servers on the first hand?
Appservers(JBoss/Weblogic) are your containers where you deploy your war or ear file. Whether you use war or ear its up to you.
Webservers (apache/IIS/iplanet) are good to hold your static content (images,htm, docs, etc...). Webservers are good at furnishing static content and would recommend to always have one.


2. What is the difference between a web server and an app server?
see above response.

3. What is the exact flow of request and response in such a case?
The request always hits the webserver first , [Now again this depends on how the environment is setup. Sometimes there are loadbalancers sitting between the user and the webservers, But for now you can assume the request always hits the webserver first.]
Webservers are smart enough to understand what request they can furnish and what needs to directed to the appserver. I have worked with apache webserver and in apache you can set this using a properties file.


4. Where is the WAR deployed and where is the EAR deployed (in web server or appserver)?
Both war & ear reside on the appserver.

Hope this help, if you have further questions/concerns/comments just shoot...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"darth vader", please check your private messages for an important administrative matter.
 
Sriram Sharma
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The explanations were pretty clear.
Thanks for that Mr.Tyagi...

Now, I have few more questions...

1. Cant we deploy war or ear in web servers? I believe we can!
2. When I googled for this, came across with some interesting information. It goes here in the next line.
"The Web server can directly reference WAR files, and there is no need to extract them back into directories and files in order to deploy them" - How is it that a webserver direcly accessess a war file? What is it that is happening here?
3. Can't we just do with app server alone? Why is a web server needed at all? If webserver can hold static contents, cant the app servers do that as well

Somebody.. please help me out in this.

Regards,
Sriram
 
Niv Tyagi
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sriram Sharma wrote:The explanations were pretty clear.
Thanks for that Mr.Tyagi...

Now, I have few more questions...

1. Cant we deploy war or ear in web servers? I believe we can!
<darthvader> No this cannot be done. web servers are inherently used to furnish only static content in java/j2ee world</darthvader>

2. When I googled for this, came across with some interesting information. It goes here in the next line.
"The Web server can directly reference WAR files, and there is no need to extract them back into directories and files in order to deploy them" - How is it that a webserver direcly accessess a war file? What is it that is happening here?
<darthvader> Not sure what you mean by "directly reference". But i will add this, web servers can be made smart enough to understand what request to furnish and what to send to app server to process. In apache this is accomplished by uriworkermap.properties & modJK. </darthvader>

3. Can't we just do with app server alone? Why is a web server needed at all? If webserver can hold static contents, cant the app servers do that as well
<darthvader> You can, nothing stops you from using the appserver alone, but in case of big enterprise application you can offload the appserver by using a web server as a front end. </darthvader>

Somebody.. please help me out in this.

Regards,
Sriram

 
Sriram Sharma
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Awesome Thanks a lot...
They made my thoughts pretty clear.
With respect to my 2nd question, here below I have pasted the link

http://msdn.microsoft.com/en-us/library/aa478983.aspx

You can find the following statement in this link...
"Deployment of JSP Web applications is quite different from deployment of ASP.NET applications. JSP applications are packaged into Web Archive (WAR) files that must then be copied to the Web server. The Web server can directly reference WAR files, and there is no need to extract them back into directories and files in order to deploy them."

If you are able to understand this, please enlighten me as well.
Based on the above statement only I got the feel that war/ear can be deployed in web servers.

Regards,
Sriram
 
Niv Tyagi
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

First rule do not refer to any microsoft links when developing.
These suckers have no idea about development.
The link refers to web servers and then talks about tomcat it does not get better than this.(fun intended).
You can ignore this link.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic