Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Fill in the blanks in each of the following statements: a) A three-ticr, distributed Web application consists of _______,________and _________ tier. b) The _______ is the default document sent as the response to a client when the client initially interacts with a J2EE application. c) The ______ enables Enterprise Java application components to access information and resources (such as databases) that are external to an application. d) An ________ object provides access to the application’s naming environment. e) A RequestDispatcher object can _____ requests to other resources or _______ other resources as part of the current servlet’s response. f) Sun’s _________ provides XML and XSL capabilities in a Java program. g) Method _____ of interface _______ discards the session object for the current client. h) The _______for an application is the part of the URL that enables the server to deter- mine which application to execute when the server receives a request from a client. i) An Enterprise Java application container must provide a ______ that implements JNDI and enables the components executing in that container to perform name lookups to locate resources. j) The J2EE reference implementation comes with a graphical application, called the ________ that helps you deploy Enterprise Java applications.

Short Answer

Expert verified
a) presentation, application logic, data; b) index.html; c) Resource Manager; d) ENC reference; e) forward, include; f) JAXP; g) invalidate, HttpSession; h) context path; i) JNDI; j) Application Server Control.

Step by step solution

01

Recognizing Tiers in Web Application

Web applications are usually divided into three tiers: the presentation, application logic, and data tier. The presentation tier is where the user interface resides, the application logic tier processes data between the user interface and database, and the data tier is where the data is stored and managed.
02

Default Document in J2EE Application

In J2EE applications, the default document is typically the `index.html` or `index.jsp`. This file is automatically served to the client upon initial interaction if no specific page is requested.
03

Enterprise Java Access to External Resources

In Enterprise Java, the Resource Manager enables components to access external resources such as databases and enterprise information systems. This is often done via a standardized set of APIs or interfaces.
04

Accessing Application's Naming Environment

An environment naming context (ENC) reference is provided by Java Naming and Directory Interface (JNDI) to access the application's naming environment, which allows Java objects to connect to object stores or to find other objects in a network.
05

Using RequestDispatcher

A RequestDispatcher object in JavaServer Pages can either forward the request to another resource or include the content of another resource in the response. This is facilitated by the methods `forward()` or `include()`.
06

XML and XSL in Java

Sun's Java API for XML Processing (JAXP) provides XML parsing and XSL transformations capabilities in Java applications. This API enables developers to manipulate XML data easily.
07

Discarding Session Objects

The `invalidate()` method of the `HttpSession` interface is used to discard an existing session object, effectively logging the user out or ending the session.
08

Determining Application in URL

The context path is the part of the URL used by the server to determine which application to execute. This is often the part that follows the domain and precedes any specific resource identifiers.
09

JNDI Implementation in Java Containers

Containers in Enterprise Java must provide an implementation of Java Naming and Directory Interface (JNDI) to allow components to perform name lookups for resources.
10

Deploying Enterprise Java Applications

The J2EE reference implementation includes a tool called the 'Application Server Control', which is a graphical application that aids in deploying Enterprise Java applications.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

Key Concepts

These are the key concepts you need to understand to accurately answer the question.

Web Application Tiers
A web application is typically organized into three primary tiers, each serving a unique role. These tiers are:
  • Presentation Tier: This is the topmost level where the user interacts with the application. It is essentially the user interface layer, composed of web browsers, client-side web apps, or front-end interfaces that present the application's data to users.

  • Application Logic Tier: Also called the business logic tier, this is where the core functionalities of the application are executed. This layer processes the user's requests, performs calculations, accesses databases, and ensures that web services and business logic are executed correctly.

  • Data Tier: At the back end of the application setup, this tier manages the data storage and retrievals. It's where databases store and manage data, ensuring the proper data is available to the application logic tier when needed.

These layers work together to ensure that web applications are scalable, efficient, and maintainable, allowing distinct processes to operate independently yet collaboratively.
RequestDispatcher
In the realm of Java EE web applications, the RequestDispatcher plays a crucial role in managing requests between different components of the application. It is part of the servlet API and is used for inter-servlet communication.

A RequestDispatcher object can perform two main tasks:
  • Forwarding Requests: The `forward()` method allows a servlet to forward the request to another resource, such as another servlet, JSP file, or an HTML file. It is used when you want to pass control to another component within the same application.

  • Including Content: The `include()` method enables a servlet to include content from another resource within the response generated by the servlet. It's useful when you want to incorporate another resource's output, like headers or footers, into the response.

Utilizing RequestDispatcher effectively enables seamless integration of different components, ensuring better application flow and modularization.
Java Naming and Directory Interface (JNDI)
The Java Naming and Directory Interface (JNDI) is a powerful Java API designed to provide naming and directory functionality to Java applications. Think of JNDI as a directory service that allows Java applications to discover and look up data and resources by names rather than physical or network paths.

Here’s how JNDI is typically used in Java EE:
  • Naming: It helps in accessing the names of objects such as EJBs (Enterprise JavaBeans) or JMS (Java Message Service) components defined in the environment, thus simplifying resource access.

  • Directory: JNDI supports various directory services to which Java applications can be connected. These include LDAP, DNS, and more, allowing for a universal approach to interacting with various directory and naming services.

  • Resource Lookup: Within Java EE environments, JNDI is crucial for performing lookups for resources like databases, queues, etc.

By providing a consistent API for accessing a wide range of naming and directory services, JNDI offers developers a straightforward way to work with application resources.
HttpSession Interface
State management in web applications is essential, given that HTTP is a stateless protocol. This is where the HttpSession interface in Java EE comes into play. It maintains session state between the client and the server, ensuring that a user's state persists across multiple requests.

Key functionalities of the HttpSession interface include:
  • Session Creation: As soon as a user interacts with a web server application, a session is created to keep track of the user's activities.

  • Session Tracking: HttpSession helps associate each user with an individual session, uniquely tracked using a session ID. This ID is sent between the client and server in requests and responses.

  • Session Invalidating: Using the `invalidate()` method, applications can end a user session. This method ensures that the user's session data is discarded, effectively logging the user out or cleaning up resources.

Overall, HttpSession is crucial for maintaining users' state within web applications, thereby enhancing user experience by tracking interactions seamlessly.

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Modify the bookstore case study to cnable the client to change the quantity of an item currently in the shopping cart. In viewCart. jsp, display the quantity in an input element of type text in a form. Provide the user with a submit button with the value Update Cart that enables the user to submit the form to a servlet that updates the quantity of the items in the cart. The servlet should forward the request to viewCart. \(j\) sp, so the user can see the updated cart contents. Redeploy the bookstore application, and test the update capability.

State whether each of the following is true or false. If false, explain why. a) The J2EE server uses port 8080 to await client requests. b) When deploying applications with the \(\mathrm{J} 2 \mathrm{EE}\) server, you can launch the Cloudscape and J2EE servers in any order. c) Initialcontext method 1ookup locates a resource with a JNDI name. d) Method lookup returns a connection object representing the connection to the database. e) The Java 2 Enterprise Edition 1.2.1 reference implementation includes the Apache Tomcat JSP and servlet container. P When RequestDispatcher method forward is called, processing of the request by the current servlet is temporarily suspended to wait for a response from the resource to which the request is forwarded. g) Both the ServletRequest and the Servletcontext getRequestDispatchex methods throw exceptions if the argument to getRequest Dispatcher is not a servlet. h) Each resource reference has a corresponding JNDI name that is used by the deployment tool to register the resource with the Java Naming and Directory Service. i) If you do not configure your data sources and other resources before deploying an Enterprise Java application, the \(\mathrm{J} 2 \mathrm{EE}\) server will search the application to determine the resources used and register those resources with the naming server. j) Not including the full package directory structure for a class in a package will prevent the application from loading the class and from executing properly.

Create an order table and an orderItems table in the books database to storc orders placed by customers. The order table should store an orderID, an orderDate and the email address of the customer who placed the order. [Note: You will need to modify the form in Exercise 11.6 to include the customer's e-mail address]. The order Items table should store the orderID, ISBN, price and quantity of cach book in the order. Modify process.jsp so that it stores the order information in the order and orderttems tables.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free