From 35ee71b94ff6a6559eb80e652429c0ab05c5a9b0 Mon Sep 17 00:00:00 2001
From: ivanmaker <43081738+ivanmaker@users.noreply.github.com>
Date: Sun, 11 Nov 2018 18:14:03 -0800
Subject: [PATCH] Add files via upload
---
YahooServlet.java | 29 +++++++++
pom.xml | 140 +++++++++++++++++++++++++++++++++++++-----
stockQuote.jsp | 46 ++++++++++++++
stockQuoteResults.jsp | 28 +++++++++
4 files changed, 226 insertions(+), 17 deletions(-)
create mode 100644 YahooServlet.java
create mode 100644 stockQuote.jsp
create mode 100644 stockQuoteResults.jsp
diff --git a/YahooServlet.java b/YahooServlet.java
new file mode 100644
index 0000000..b3b0a57
--- /dev/null
+++ b/YahooServlet.java
@@ -0,0 +1,29 @@
+package com.origamisoftware.teach.advanced.services;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Calendar;
+import javax.servlet.http.*;
+
+/**
+ * BasicServlet request data from the web service that is used by the WebStockService
+ */
+public class YahooServlet extends HttpServlet{
+ private String symbol;
+ private Calendar d1, d2;
+
+ public YahooServlet(String symbol, Calendar from, Calendar until){
+ this.symbol = symbol;
+ this.d1 = from;
+ this.d2 = until;
+ }
+ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+
+ PrintWriter out = response.getWriter();
+ out.println("");
+ out.println("
");
+ out.println("http://finance.yahoo.com/d/quotes.csv?s="+ symbol + "&f=" + d1 + d2);
+ out.println("");
+ out.println("");
+ }
+}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index a6da30f..9429aac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,18 +1,124 @@
-
- 4.0.0
- edu.isaacVazquez.advancedjava
- isaacVazquez-app
- jar
- 1.0-SNAPSHOT
- isaacVazquez-app
- http://maven.apache.org
-
-
- junit
- junit
- 3.8.1
- test
-
-
+
+ 4.0.0
+ com.origamisoftware.teach.effective
+ week-6-stock-ticker-solution
+ jar
+ 1.0-SNAPSHOT
+ week-6-stock-ticker-solution
+ http://maven.apache.org
+
+
+ UTF-8
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+ -Xlint
+ ${project.build.sourceEncoding}
+ 1.8
+ 1.8
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.19.1
+
+ true
+
+
+
+
+
+
+
+
+
+ junit
+ junit
+ 4.10
+ jar
+
+
+
+ mysql
+ mysql-connector-java
+ 5.1.6
+
+
+
+ javax.validation
+ validation-api
+ 1.0.0.GA
+
+
+
+ org.mockito
+ mockito-all
+ 1.9.5
+
+
+
+ org.apache.httpcomponents
+ httpcore
+ 4.4
+
+
+
+ org.apache.ibatis
+ ibatis-sqlmap
+ 2.3.4.726
+
+
+
+ org.hibernate
+ hibernate-core
+ 4.2.6.Final
+
+
+
+ org.hibernate.javax.persistence
+ hibernate-jpa-2.0-api
+ 1.0.1.Final
+
+
+
+ com.yahoofinance-api
+ YahooFinanceAPI
+ x.y.z
+
+
+
+ javax.servlet
+ jstl
+ 1.2
+
+
+
+ javax.servlet
+ javax.servlet-api
+ 3.0.1
+ provided
+
+
+
+ javax.servlet.jsp.jstl
+ jstl-api
+ 1.2
+
+
+ org.hibernate
+ hibernate-core
+ 4.2.6.Final
+
+
+
diff --git a/stockQuote.jsp b/stockQuote.jsp
new file mode 100644
index 0000000..2f2d8cb
--- /dev/null
+++ b/stockQuote.jsp
@@ -0,0 +1,46 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8" %>
+
+
+
+
+
+
+
+
+
+ Stock Quote Request
+
+
+
+ Please enter StockQuery information:
+
+
+
+ Retrieve Data form the Database:
+
+
+
+ Retrieve Data form the Yahoo Finance Web App:
+
+
+
+
+
diff --git a/stockQuoteResults.jsp b/stockQuoteResults.jsp
new file mode 100644
index 0000000..b738c10
--- /dev/null
+++ b/stockQuoteResults.jsp
@@ -0,0 +1,28 @@
+
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ page import="javax.servlet.http.*" %>
+
+
+
+
+
+
+
+
+
+ Stock Quote Query Results
+
+
+Your Stock Quote
+
+Symbol: <%= StockQuery.getSymbol() %>
+Date From: <%= StockQuery.getFrom() %>
+Date Until: <%= StockQuery.getUntil() %>
+Interval in Minutes: <%= Interval.getMinutes() %>
+
+<%=
+YahooServlet.doGet(HttpServletRequest request, HttpServletResponse response)
+%>
+Thank you!
+
+