Web server and Application server
(Images from https://stock.adobe.com, https://apache.org, https://nginx.org and https://oracle.com.)
Web server
・ Apache, Nginx, IIS, etc...
・ Get request from client and responses to client(web browser) by Http protocol.
・ Manage static file.(html, jpg)
・ If Web server have untouchable informations(dynamic info.), send it to Application server.Application server
・ Is middle ware.
・ Tomcat, Jeus, JBoss, WebLogic, WebSphere, etc...
・ Manage dynamic informations that is given by web server.
・ Typically, AS can service as web server without web sever.
・ Send static informations that is treated to web server in order to be handled informations by web server.Types of Web server
・ Merged web server to application server.
- In case small web server, it is efficient.
- Concentrate all the contents in one place to perform the role of web server and AS at the same time and load balancing through switch.
・ split web server and one application server.
- Functional classification of web server and AS induces effective distribution, static data is processed by web server, dynamic data is processed by AS.
・ split web server and multi application servers.
- Although the WAS stage can be divided into presentation logic and business logic, it can cope with a specific logic load, but the design phase maintenance step can be complicated.
(Images from https://oracle.com.)
Structure of Application server and sequence
⓪ When a request comes in from the web server, the container handles it appropriately.
① The container references the deployment descriptor (web.xml) to create a thread for the servlet and creates and dispatches the request (httpServletRequest) and response (httpServiceResponse) objects.
② the container calls servlet (service ()).
③ The thread responsible for the task of the invoked servlet (pre-created thread) calls doPost () or doGet () on demand.
④ The called doPost () or doGet () method loads the generated dynamic page into the Response object and passes it to the container.
⑤ The container converts the received Response object into HTTPResponse form, passes it to the Web server, terminates the created thread, and destroys the request (httpServletRequest) and response (httpServiceResponse) objects.Container
・ AS has various types of containers built in, and among them, the collection of functions related to the servlet is called a servlet container. There are many other kinds of containers (Servlet container, JSP container, EJB container, etc.) and various components are built in.
・ Servlet container is convenient because it handles the complicated parts that developers need to care about in executing servlet and managing servlet as in [Figure: Internal structure of WAS]. One example is that there is no main () method required when developing a Java application. The following are the main roles of the servlet container.
- Lifecycle management: Load and initialize the servlet (init method). It also calls the servlet method on the client's request. When the servlet container is finished, it shuts down the servlet (calling the destroy method) and cleans up the memory.
- Communication support: It analyzes the request received from the web server and executes the servlet. Servlet provides the function to check the information of the web server.
- Multithreading support: Servlets are created at the request of the client, and requests for already created servlets are created and executed.
- Component
A technology that allows a specific function or related function to be executed in a reusable form as a program building block that allows software development to proceed as if it were a block of software. - EJB Component
- EJB is a tool for distinguishing between business logic and presentation.
- Spring can replace EJB.
- Spring was born to secure EJB.
- The EJB alone can not function as a spring.
Congratulations @lineplus! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of posts published
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard!
Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @lineplus! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit