Answered step by step
Verified Expert Solution
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:
- The user types a stock symbol in a text box on an HTML form and clicks the submit button.
- 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.
- The servlet creates a bean object and stores the stock data in the bean.
- The servlet stores the bean in the request object (using setAttribute), gets a RequestDispatcher from the request, and then forwards to the JSP.
- The JSP uses a "jsp:useBean" element to access the bean, and "jsp:getProperty" elements to retrieve the bean data.
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started