Java EE Interview Questions - Part 2
- Within the context of Jakarta EE 10, what is the purpose of the web container?
Answer:
In Jakarta EE 10, the web container is a core component of a Jakarta EE-compliant application server responsible for managing and executing web-based components, such as servlets, JavaServer Pages (JSP), and JavaServer Faces (JSF), along with supporting web-related functionalities. It provides a runtime environment for web applications, handling HTTP requests and responses, managing the lifecycle of web components, and integrating with other Jakarta EE services. Below is a detailed explanation of the purpose of the web container in Jakarta EE 10.
- What is the Jakarta EE container?
Answer:
It manages the execution of enterprise beans for java-ee applications.
Enterprise beans and their container run on the java-ee server.
- What is Applet container?
Answer:
The applet container manages the execution of applets.
The applet container consists of a Web browser and Java Plugin running on the client together.
- How do we package java-ee components?
Answer:
java-ee components are packaged separately and bundled into a java-ee application for deployment.
The following elements are assembled into a module and added to the java-ee application.
- Each component,
- its related files such as GIF and HTML files or server-side utility classes, and
- a deployment descriptor .
A java-ee application is composed of one or more enterprise bean,Web, or application client component modules.
The final enterprise solution can use one java-ee application or be made up of two or more java-ee applications.
A java-ee application and each of its modules has its own deployment descriptor.
A deployment descriptor is an XML document with an .xml extension that describes a component’s deployment settings.
- What is a thin client?
Answer:
A thin client is a lightweight interface to the application that does not have such operations like
- query databases,
- execute complex business rules, or
- connect to legacy applications.
- What are types of java-ee clients?
Answer:
The following are the types of java-ee clients:
- Applets
- Application clients
- Java Web Start-enabled rich clients, powered by Java Web Start technology.
- Wireless clients, based on Mobile Information Device Profile (MIDP) technology.
- What is a deployment descriptor?
Answer:
A deployment descriptor is an Extensible Markup Language (XML) text-based file with an .xml extension that describes a component’s deployment settings. A java-ee application and each of its modules has its own deployment descriptor. For example, an enterprise bean module deployment descriptor declares transaction attributes and security authorizations
for an enterprise bean. Because deployment descriptor information is declarative, it can be changed without modifying the bean source code.
At run time, the java-ee server reads the deployment descriptor and acts upon the component accordingly.
- What is the EAR file?
Answer:
An EAR file is a standard JAR file with an .ear extension, named from Enterprise Archive file.
A java-ee application with all of its modules is delivered in an EAR file.
- What is JTA and JTS?
Answer:
- JTA is the abbreviation for the Java Transaction API.
- JTS is the abbreviation for the Jave Transaction Service.
JTA provides a standard interface and allows you to demarcate transactions in a manner that is independent of the
transaction manager implementation. The java-ee SDK implements the transaction manager with JTS. But your code does not call the JTS methods directly. Instead, it invokes the JTA methods, which then call the lower-level JTS routines.
Therefore, JTA is a high level transaction interface that your application uses to control transactions and JTS is a low level transaction interface.
EJB uses behind the scenes (client code does not directly interact with JTS. It is based on object transaction service(OTS) which is part of CORBA. )
-
What is JAXP?
Answer:
JAXP stands for Java API for XML.
XML is a language for representing and describing text-based data which can be read and handled by any program or tool that uses XML APIs. It provides standard services
- to determine the type of an arbitrary piece of data,
- encapsulate access to it,
- discover the operations available on it,
- and create the appropriate JavaBeans component to perform those operations.
