In a typical J2EE application - would the web server have a web container or have a means for plugging in a web container? If so, the JSP/Servlets, presentation tier can be deployed on the web server and the business logic in the app server. This could also reduce the network round trips for static files.
Also would like to know if there is there any J2EE standard on this ?
I don't know that there is a "typical J2EE application". Web server, servlet container (a much more common phrase than "web container") and app server could be 3 processes on 3 machines, or 3 processes on a single machine, or just a single process on a single machine, or anything in between.
Whether it makes sense to serve static resources from the web server or the servlet container really depends on the application. There might be performance reasons for keeping them on the web server, but there might also be other considerations that makes keeping them on the servlet container preferable. Plus, it used to be that servlet containers such as Tomcat weren't particularly good at serving static content, but those days are long gone.
Ping & DNS - updated with new look and Ping home screen widget
Joined: Oct 02, 2002
It was the other factors that i wanted to know about.
To be specific, would having a web server(web container) + app server be a better combination than having a web server that routes all requests to the app server(web container + ejb container) ?
I thought the former approach having web container in the web server was better in the sense that the requests that do not need much business processing (ejb), need not be sent to the business tier in the app server and can be handled by the web server itself. Also, if this is the case, why do deployments of J2EE apps happen through a single ear in the app server ?
In anycase, i do agree that the static files could be served by the web server itself.
Would appreciate a response for this.
Joined: Mar 22, 2005
There are no general answers. Both separating web server and servlet container, and keeping them together, has advantages and disadvantages. It really depends on the network setup and the rest of the environment.
E.g., it's quite common to front a group of servlet containers with an Apache web server which handles clustering, failover and SSL termination.
Load issues also play a role - will more app servers than servlet containers be needed, or less, or just as many? That influences decisions about what to colocate on the same server.
Joined: Oct 02, 2002
Thanks for the response.
I also got an explanation from Mastering EJB - Ed Roman. Chapter 19 on Clustering. It talks about distributed and co-located architectures.
Hi Dittmer, You can manage all application deployment in one system it self or ..... Static pages are into Web Server, Business logic into App Server and so on.... Depends on your business ... But the thing is Keeping mind for performance they are placing separate.... If I have high end server I can have all it one ...