Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To get data for other stocks you need to register with Alpha Vantage and get your own API Key (this is free) here. You can

  • To get data for other stocks you need to register with Alpha Vantage and get your own API Key (this is free) here. You can also find full documentation for the Alpha Vantage api.

This assignment is to reimplement the stock quote service from Homework #1 as a web application using HTML, a java servlet, and a JSP page. For full credit, your application should use the MVC (Model-View-Controller) pattern with following components:

  • The model, consisting of:
    • The Alpha Vantage finance service.
    • A java bean class (similar to the StockQuote class from Homework #1) to represent the requested stock data.
  • The view, consisting of:
    • A static html form where the user enters a stock symbol.
    • A JSP page that displays the requested data.
  • The control consisting of:
    • A java servlet to obtain the data from Alpha Vantage, package it in a bean, and forward to the JSP for formatting.

The sequence of events when a user requests a stock quote should be:

  1. The user types a stock symbol in a text box on an HTML form and clicks the submit button.
  2. The java servlet retrieves the stock symbol from the request, and gets the current price, price change, high, and low from the Alpha Vantage service.
  3. The servlet creates a bean object and stores the stock data in the bean.
  4. The servlet stores the bean in the request object (using setAttribute), gets a RequestDispatcher from the request, and then forwards to the JSP.
  5. The JSP uses a "jsp:useBean" element to access the bean, and "jsp:getProperty" elements to retrieve the bean data.
  6. The JSP generates HTML output with the requested data to display in the browser.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

Does it exceed two pages in length?

Answered: 1 week ago

Question

Does it avoid typos and grammatical errors?

Answered: 1 week ago