J2EE FAQ 3  «Prev  Next»

J2EE Interview Questions - FAQ Part 3

  1. Question: What is a J2EE Connector?
    Answer: The J2EE Connector API is used by J2EE tools vendors and system integrators to create resource adapters that support access to enterprise information systems that can be plugged into any J2EE product. Each type of database or EIS has a different resource adapter.
    Note: A resource adapter is a software component that allows J2EE application components to access and interact with the underlying resource manager. Because a resource adapter is specific to its resource manager, there is typically a different resource adapters for each type of database or enterprise information system.
  2. Question: What is JAAP?
    Answer: The Java Authentication and Authorization Service (JAAS) provides a way for a J2EE application to authenticate and authorize a specific user or group of users to run it. It is a standard Pluggable Authentication Module (PAM) framework that extends the Java 2 platform security architecture to support user-based authorization.
  3. Question: What is Java Naming and Directory Service?
    Answer:The JNDI provides naming and directory functionality. It provides applications with methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes. Using JNDI, a J2EE application can store and retrieve any type of named Java object. Because JNDI is independent of any specific implementations, applications can use JNDI to access multiple naming and directory services, including existing naming and directory services such as LDAP, NDS, DNS, and NIS.
  4. Question: What is Struts?
    Answer: A Web page development framework. Struts combines Java Servlets, Java Server Pages, custom tags, and message resources into a unified framework. It is a cooperative, synergistic platform, suitable for development teams, independent developers, and everyone between.
  5. Question: How is the MVC design pattern used in Struts framework?
    Answer: In the MVC design pattern, application flow is mediated by a central Controller. The Controller delegates requests to an appropriate handler. The handlers are tied to a Model, and each handler acts as an adapter between the request and the Model. The Model represents, or encapsulates, an application’s business logic or state. Control is usually then forwarded back through the Controller to the appropriate View. The forwarding can be determined by consulting a set of mappings, usually loaded from a database or configuration file. This provides a loose coupling between the View and Model, which can make an application significantly easier to create and maintain.
    1. Controller: Servlet controller which supplied by Struts itself;
    2. View: what you can see on the screen, a JSP page and presentation components;
    3. Model: System state and a business logic JavaBeans.
  6. What makes J2EE suitable for distributed multitiered Applications?
    Answer: The J2EE platform uses a multitiered distributed application model. Application logic is divided into components according to function, and the various application components that make up a J2EE application are installed on different machines depending on the tier in the multitiered J2EE environment to which the application component belongs. The J2EE application parts are:
    1. Client-tier components run on the client machine.
    2. Web-tier components run on the J2EE server.
    3. Business-tier components run on the J2EE server.
    4. Enterprise information system (EIS)-tier software runs on the EIS server.
  7. What is J2EE?
    Answer: J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitiered, web-based applications.
  8. What are the components of J2EE application?
    Answer: A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:
    1. Application clients and applets are client components.
    2. Java Servlet and JavaServer Pages technology components are web components.
    3. Enterprise JavaBeans components (enterprise beans) are business components.
    4. Resource adapter components provided by EIS and tool vendors.
  9. What do Enterprise JavaBeans components contain?
    Answer: Enterprise JavaBeans components contains Business code, which is logic that solves or meets the needs of a particular business domain such as banking, retail, or finance, is handled by enterprise beans running in the business tier.
    All the business code is contained inside an Enterprise Bean which receives data from client programs, processes it (if necessary), and sends it to the enterprise information system tier for storage. An enterprise bean also retrieves data from storage, processes it (if necessary), and sends it back to the client program.
  10. Is J2EE application only a web-based?
    Answer: No, It depends on type of application that client wants. A J2EE application can be web-based or non-web-based. if an application client executes on the client machine, it is a non-web-based J2EE application. The J2EE application can provide a way for users to handle tasks such as J2EE system or application administration. It typically has a graphical user interface created from Swing or AWT APIs, or a command-line interface. When user request, it can open an HTTP connection to establish communication with a servlet running in the web tier.