Contents   |  Previous   |  Next   |  Home

FAQS on Enterprise Java / Distributed Java

Servlets
JSP
JNDI
EJB

Servlets


What is a servlet

Servlets are modules residing on the servers to provide dynamic content to the clients. Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. Servlets have no graphical user interface. Servlets are a replacement to the CGI. Servlets sits between the clients in the Internet and the resources on the server. When a client interacts with the servlet, the servlet receives two objects
ServletRequest, which contains the communication from the client to the server.
ServletResponse, which contains the communication from the servlet back to the client. The servlet can read the client requests and data from the ServletRequest, process the request by requesting services from the resources on the server and send a response to the client through the ServletResponse

What are the comparable technologies to servlets
CGI is the comparable technology to the servlets

Where can a servlet be used effectively
Servlets can be used where a Java solution is appropriate. Servlets can be implemented with 100% Java code. Servlets can be used where the robustness is needed for the application. Scalability with the servlets are easy. Java security can be used. Servlets can be used to access resources on the server such as Data, business logic. Business logic in implemented in EJB can be accessed through Java.

Advantages of servlets
Servlets get initialized once it is loaded. Servlets remain in memory until it is unloaded. Servlets can be deployed 24 hours a day , 7 days a week. 24 x 7. Servlets can pool expensive resources as database connection, user data. Servlets run multi threaded. Servlets can process multiple requests at a time.

Advantages of servlets over CGI
CGI span a process for each request. A single servlet instance can process multiple requests. CGI is stateless, servlets are statefull. CGI cannot pool resources, servlets can pool resources.
What are the commercial available servlet engines

How scalability of servlet achieved
Servlets are highly scalable. Servlets can forward request for processing. Servlets can balance load by forwarding requests to be handled by other servers. Servlets can be made lightweight to act as receive requests and transmit response. The processing can be done in other business Java objects. The processing is done multithreaded. The processing can be achieved through EJB in the same or another server.
How robust is servlet
Servlets are highly functional. The robustness comes from the implementation.



JSP


What is a JSP

JSP is Java Server Page. JSP is a html page with embedded Java code. The HTML takes care of the page layout. The Java code takes care of the dynamic content of the page. JSP is a text file with an extension of jsp. Once a client requests a jsp page, if the particular jsp is not loaded in meemory, the jsp is compiled and converted as a servlet. Successive requests to the jsp are handled by the loaded jsp as servlet.

What are the comparable technologies to JSP
ASP, active server pages, servlets are comparable technologies.

Where can a JSP be used.
Jsp can be used where a number of personal with different roles play a part in the creation of the HTML page. A page where a programmer codes for the logic , a webmaster for the layout and a marketing people provide the dynamic content. Example A web page of a online bookstore. Programmer codes the logic to retrieve the data from the database for the user selection inputs. Webmaster decides the layout of the page. The marketing people give the dynamic content every hour or every day as news flashes.

Advantages of JSP
Easy to provide dynamic content in a static page. Easy to start with Java. Not all code is Java, a snippet here and there is Java. People with different roles can work together easily. Layout can be changed without affecting the logic. No need to recompile the Java classes if the layout changes.

Disadvantages of JSP
Logic and the content are not well separated. You are writing the business logic in scriptlet, even though Java is the scriptlet language. Scalability may not be so good. If you deploy 20 JSP 20 servlets are instantiated on the server. If you deploy 200 JSP then 200 servlets are instantiated on the server.

Advantages of servlets over JSP
A servlet can handle different dynamic pages. Even if the pages to be deployed are 20 or 200, one servlet can handle. In jsp a servlet is deployed for every jsp page.

What are the commercial available JSP ? compatible



EJB

What is an EJB
Enterprise Java bean, EJB is a server side component. Ejb can be used for distributed computing. EJB contains EJB object, Ejb Server and EJB Container. EJB object runs within an ejb container, which runs within a ejb server. Ejb object is the business logic component. Which handles the business logic. The ejb object does not take into consideration the deployment platform. The ejb server and ejb container provide transactional processing. Ejb container creates, maintains and destroys the ejb objects. Ejb objects can be deployed in any ejb server/container.
What are the comparable technologies to EJB
Corba, DCOM and RMI are the comparable technology
Where can a EJB be used effectively
EJB can be used where platform independent deployment is needed. Ejb is highly scalable. When plug and play is needed from different vendors.
Advantages of EJB

Advantages of EJB over RMI

Advantages of EJB over CORBA

What is an EJB server

What is an EJB container

What is an EJB object

What are the roles in an EJB application development

What are the commercial available EJB servers

How scalability of EJB achieved

How robust is EJB

What is the maturity of EJB

What is the future of EJB

JNDI

What is a JNDI

What are the comparable technologies to JNDI
Where can a JNDI be used
Advantages of JNDI
Advantages of JNDI over ??
What are the commercial available JNDI ? compatible
XML
What is a XML
What are the comparable technologies to XML
Where can a XML be used
Advantages of XML
Advantages of XML over ??
What are the commercial available XML? Compatible to XML

Contents |  Previous  |  Next   |  Index

Last Modified on : 2/2/2000 by PRR
Contact prasks with questions or suggestion.
All rights reserved. Terms of use.
All products and companies mentioned at this site are trademarks of their respective owners.