What are the responsibilities of Web container, EJB container and JNDI?

Questions by kirankumar samudrala   answers by kirankumar samudrala

Showing Answers 1 - 3 of 3 Answers

1) The webserver plug-in examines the url, verifies the list of host name aliases from which it wil accept traffic based on the virtual host information, and chooses a server to handle the request.


WEB CONTAINER:

2) A stream is created. A stream is a connection  to the web container.The web container receives the request and based on the url, dispatches it to the proper servlet.
3) If the servlet class is not loaded, dynamic class loader loads the servlet.

JNDI:

4) JNDI is used to look up of either databases or ejb connection by the servlet. JNDI directs the servlet depending on the servlet request.
 --> To the corresponding database and gets a connection from its connection pool in the case of servlet wants the datasource 
 --> To the corresponding EJB container, which then instantiates the EJB when EJB is requested.

5) IF ejb container have to execute some sql operation , it has to go to the jndi to lookup the datasource..
The sql statement is executed and the retrieved data is sent back to the EJB or to the servlet..

Data beans are created and handed off to jsps in the case of EJBs
 The jsp generates the html, i e sent back to through the plug-in to the webserver
  The webserver sends the output page to the requested browser


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions