diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..a65bf3836e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.iml +target/ +.idea/ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000..aac788ff3b --- /dev/null +++ b/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + + com.codeup.adlister + adlister + 1.0-SNAPSHOT + war + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.0 + + 1.8 + 1.8 + + + + + + + + javax.servlet + javax.servlet-api + 3.0.1 + + + jstl + jstl + 1.2 + + + + + \ No newline at end of file diff --git a/src/main/java/ColorPageServlet.java b/src/main/java/ColorPageServlet.java new file mode 100644 index 0000000000..a2bbdb9b84 --- /dev/null +++ b/src/main/java/ColorPageServlet.java @@ -0,0 +1,20 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name="ColorPageServlet", urlPatterns = "/pickcolor") +public class ColorPageServlet extends HttpServlet { + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + req.getRequestDispatcher("/pickcolor.jsp").forward(req,resp); + } + +// @Override +// protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { +// req.getParameter("pickColor"); +// req.getRequestDispatcher("/viewcolor.jsp").forward(req,resp); +// } +} diff --git a/src/main/java/CorrectServlet.java b/src/main/java/CorrectServlet.java new file mode 100644 index 0000000000..fb8049da12 --- /dev/null +++ b/src/main/java/CorrectServlet.java @@ -0,0 +1,19 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + + +@WebServlet(name="CorrectServlet", urlPatterns = "/correct") + +public class CorrectServlet extends HttpServlet { + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + request.setAttribute("guessResult","correct"); + request.getRequestDispatcher("/guessResult.jsp").forward(request, response); + + + } +} diff --git a/src/main/java/CounterServlet.java b/src/main/java/CounterServlet.java new file mode 100644 index 0000000000..04225dd566 --- /dev/null +++ b/src/main/java/CounterServlet.java @@ -0,0 +1,24 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet( name = "CounterServlet", urlPatterns = "/count") +public class CounterServlet extends HttpServlet { + int count = 0; + protected void doGet(HttpServletRequest req, HttpServletResponse res)throws IOException, ServletException { + String reset = req.getParameter("reset"); + if(reset != null){ + count = 0; + } + + count++; + res.getWriter().println("this page has been visited " + count + " times!"); + + + } + +} + diff --git a/src/main/java/GuessServlet.java b/src/main/java/GuessServlet.java new file mode 100644 index 0000000000..26c251b3a4 --- /dev/null +++ b/src/main/java/GuessServlet.java @@ -0,0 +1,34 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + + +@WebServlet(name="GuessServlet", urlPatterns = "/guess") + +public class GuessServlet extends HttpServlet { +@Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + String guess = request.getParameter("guess"); + int random = (int) Math.floor((Math.random() * 3) + 1); + String randomNumString = Integer.toString(random); + + if(guess.equalsIgnoreCase(randomNumString)){ + response.sendRedirect("/correct"); + }else if(!guess.equalsIgnoreCase(randomNumString)){ + response.sendRedirect("/incorrect"); + } +// request.setAttribute("guessResult", guess); +// request.getRequestDispatcher("/guessResult.jsp").forward(request, response); + } + +@Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + request.getRequestDispatcher("/guess.jsp").forward(request, response); + + } +} diff --git a/src/main/java/HelloServlet.java b/src/main/java/HelloServlet.java new file mode 100644 index 0000000000..9b97c8259c --- /dev/null +++ b/src/main/java/HelloServlet.java @@ -0,0 +1,21 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name = "HelloServlet ",urlPatterns = "/helloLecture") +public class HelloServlet extends HttpServlet { + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String name = request.getParameter("name"); + + if(name == null){ + name = "World"; + }else if(name .equalsIgnoreCase("kelvon")){ + name = "Mr.Patterson"; + } + request.setAttribute("viewName", name); + request.getRequestDispatcher("/hello.jsp").forward(request,response); + } +} diff --git a/src/main/java/HelloWorldServlet.java b/src/main/java/HelloWorldServlet.java new file mode 100644 index 0000000000..ad8c88d392 --- /dev/null +++ b/src/main/java/HelloWorldServlet.java @@ -0,0 +1,24 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet( name = "HelloWorldServlet", urlPatterns = "/hello") +public class HelloWorldServlet extends HttpServlet { +//added comment + + protected void doGet(HttpServletRequest req, HttpServletResponse res)throws IOException, ServletException { + String name = req.getParameter("name"); + if( name == null){ + name = "World"; + res.getWriter().println("

Hello World

"); + } + + res.getWriter().println("

hello, " + name + " !

"); + + + } + +} diff --git a/src/main/java/IncorrectServlet.java b/src/main/java/IncorrectServlet.java new file mode 100644 index 0000000000..6b6154f29f --- /dev/null +++ b/src/main/java/IncorrectServlet.java @@ -0,0 +1,19 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + + +@WebServlet(name="IncorrectServlet", urlPatterns = "/incorrect") + +public class IncorrectServlet extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + request.setAttribute("guessResult","incorrect"); + request.getRequestDispatcher("/guessResult.jsp").forward(request, response); + + } +} diff --git a/src/main/java/MvcLecture/CreateProductServlet.java b/src/main/java/MvcLecture/CreateProductServlet.java new file mode 100644 index 0000000000..f5d706ba30 --- /dev/null +++ b/src/main/java/MvcLecture/CreateProductServlet.java @@ -0,0 +1,30 @@ +package MvcLecture; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name="CreateProductServlet", urlPatterns = "/products/create") +public class CreateProductServlet extends HttpServlet { + + + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + request.getRequestDispatcher("/createProduct.jsp").forward(request, response); + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + Products productsDao = DaoFactory.getProductsDao(); + // create a new product based on the submitted data + String name = request.getParameter("name"); + double price = Double.parseDouble(request.getParameter("price")); + Product product = new Product(name, price); + // persist the new product + productsDao.insert(product); + response.sendRedirect("/products"); + } +} diff --git a/src/main/java/MvcLecture/CsvProductsDao.java b/src/main/java/MvcLecture/CsvProductsDao.java new file mode 100644 index 0000000000..f6bbab3266 --- /dev/null +++ b/src/main/java/MvcLecture/CsvProductsDao.java @@ -0,0 +1,4 @@ +package MvcLecture; + +public class CsvProductsDao { +} diff --git a/src/main/java/MvcLecture/DaoFactory.java b/src/main/java/MvcLecture/DaoFactory.java new file mode 100644 index 0000000000..cf351adda9 --- /dev/null +++ b/src/main/java/MvcLecture/DaoFactory.java @@ -0,0 +1,12 @@ +package MvcLecture; + +public class DaoFactory { + private static Products productsDao; + + public static Products getProductsDao(){ + if(productsDao == null){ + productsDao = new ListProductsDao(); + } + return productsDao; + } +} diff --git a/src/main/java/MvcLecture/ListProductsDao.java b/src/main/java/MvcLecture/ListProductsDao.java new file mode 100644 index 0000000000..d09c6cb159 --- /dev/null +++ b/src/main/java/MvcLecture/ListProductsDao.java @@ -0,0 +1,31 @@ +package MvcLecture; + +import java.util.ArrayList; +import java.util.List; + +public class ListProductsDao implements Products{ + //structure to return all the products + private List products = new ArrayList<>(); + + + // When an instance of this class is created, we'll populate the + // products array list with data, "faking" the records + public ListProductsDao(){ + insert(new Product("hammer", 9.99)); + insert(new Product("screwdriver", 9.99)); + insert(new Product("drill", 19.99)); + } + + @Override //@Override makes sure we are overriding from the super + + public List all() { + return this.products; + } + + @Override //@Override makes sure we are overriding from the super + // Persist a new record. We'll simulate this by adding the passed object + // to our internal array list of products. + public void insert(Product product) { + this.products.add(product); + } +} diff --git a/src/main/java/MvcLecture/Product.java b/src/main/java/MvcLecture/Product.java new file mode 100644 index 0000000000..14be671f6f --- /dev/null +++ b/src/main/java/MvcLecture/Product.java @@ -0,0 +1,14 @@ +package MvcLecture; + +public class Product { + private String name; //fields(informed by the entity + private double price;//fields + + public Product(){ + //empty constructor always necessary + } + public Product(String name, double price){ + this.name = name; + this.price=price; + }//filled constructor +} diff --git a/src/main/java/MvcLecture/Products.java b/src/main/java/MvcLecture/Products.java new file mode 100644 index 0000000000..19f01b69c1 --- /dev/null +++ b/src/main/java/MvcLecture/Products.java @@ -0,0 +1,10 @@ +package MvcLecture; + + +import java.util.List; + +public interface Products { + //here we provide the behaviors/methods // List Data types + List all(); + void insert(Product product); +} diff --git a/src/main/java/MvcLecture/ShowProductsServlet.java b/src/main/java/MvcLecture/ShowProductsServlet.java new file mode 100644 index 0000000000..44651eecb4 --- /dev/null +++ b/src/main/java/MvcLecture/ShowProductsServlet.java @@ -0,0 +1,28 @@ +package MvcLecture; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +@WebServlet(name= "ShowProductServlet", urlPatterns = "/products") +public class ShowProductsServlet extends HttpServlet { + + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { + //"Hey Servlet go instantiate from that getProductsDao method i set up! == get a DAI object + Products productsDao= DaoFactory.getProductsDao(); + + //Let's go get the products + + List showProducts = productsDao.all(); + + + req.setAttribute("products", showProducts); + req.getRequestDispatcher("/productIndex.jsp").forward(req, res); + // + } +} diff --git a/src/main/java/PizzaOrderServlet.java b/src/main/java/PizzaOrderServlet.java new file mode 100644 index 0000000000..02ed6b0b02 --- /dev/null +++ b/src/main/java/PizzaOrderServlet.java @@ -0,0 +1,29 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name="PizzaOrderServlet", urlPatterns = "/pizza-order") +public class PizzaOrderServlet extends HttpServlet { + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + req.getRequestDispatcher("/pizza-order.jsp").forward(req,resp); + } + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + System.out.println(req.getParameter("crust")); + System.out.println(req.getParameter("sauce")); + System.out.println(req.getParameter("crust-size")); + System.out.println(req.getParameter("pepperoni")); + System.out.println(req.getParameter("sausage")); + System.out.println(req.getParameter("bacon")); + System.out.println(req.getParameter("onion")); + System.out.println(req.getParameter("mushrooms")); + System.out.println(req.getParameter("pineapple")); + System.out.println(req.getParameter("address")); + req.getRequestDispatcher("/pizza-order.jsp").forward(req,resp); + } +} diff --git a/src/main/java/ViewColorServlet.java b/src/main/java/ViewColorServlet.java new file mode 100644 index 0000000000..5282572e91 --- /dev/null +++ b/src/main/java/ViewColorServlet.java @@ -0,0 +1,20 @@ +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +@WebServlet(name="ViewColorServlet", urlPatterns = "/viewcolor") +public class ViewColorServlet extends HttpServlet { +// @Override +// protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { +// req.getRequestDispatcher("/viewcolor.jsp").forward(req,resp); +// } + + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + req.setAttribute("pickColor",req.getParameter("pickColor")); + req.getRequestDispatcher("/viewcolor.jsp").forward(req,resp); + } +} diff --git a/src/main/webapp/createProduct.jsp b/src/main/webapp/createProduct.jsp new file mode 100644 index 0000000000..e4f8cd5129 --- /dev/null +++ b/src/main/webapp/createProduct.jsp @@ -0,0 +1,25 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 6/1/21 + Time: 10:11 AM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Create A Product + + +

Create A Product

+
+ + +
+ + +
+ +
+ + diff --git a/src/main/webapp/css/styles.css b/src/main/webapp/css/styles.css new file mode 100644 index 0000000000..1682cb34ce --- /dev/null +++ b/src/main/webapp/css/styles.css @@ -0,0 +1,6 @@ +body{ + background-color: cornflowerblue; +} +h1{ + color: lightskyblue; +} \ No newline at end of file diff --git a/src/main/webapp/guess.jsp b/src/main/webapp/guess.jsp new file mode 100644 index 0000000000..c086196367 --- /dev/null +++ b/src/main/webapp/guess.jsp @@ -0,0 +1,28 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/28/21 + Time: 12:16 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Guessing Game + + +

Welcome to the guessing game !!

+

In this game you will guess a number between 1 and 3! Please submit your answer below in the text field!

+
+
+ + +
+
+ + + + +
+ + diff --git a/src/main/webapp/guessResult.jsp b/src/main/webapp/guessResult.jsp new file mode 100644 index 0000000000..59dcadf8c9 --- /dev/null +++ b/src/main/webapp/guessResult.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/31/21 + Time: 11:54 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Guess Result + + +

Your answer is ${guessResult}

+ + diff --git a/src/main/webapp/hello.jsp b/src/main/webapp/hello.jsp new file mode 100644 index 0000000000..0c3da50400 --- /dev/null +++ b/src/main/webapp/hello.jsp @@ -0,0 +1,17 @@ + +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/28/21 + Time: 11:28 AM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Hello JSP + + +

Hello there, ${viewName}!

+ + diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp new file mode 100644 index 0000000000..620be33cb0 --- /dev/null +++ b/src/main/webapp/index.jsp @@ -0,0 +1,18 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/27/21 + Time: 10:34 AM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Adlister + + +<%@ include file="partials/navbar.jsp" %> + +

All Ads

+ + diff --git a/src/main/webapp/js/scripts.js b/src/main/webapp/js/scripts.js new file mode 100644 index 0000000000..e8415d4730 --- /dev/null +++ b/src/main/webapp/js/scripts.js @@ -0,0 +1 @@ +console.log("It works!!") \ No newline at end of file diff --git a/src/main/webapp/login.jsp b/src/main/webapp/login.jsp new file mode 100644 index 0000000000..d1273123f4 --- /dev/null +++ b/src/main/webapp/login.jsp @@ -0,0 +1,53 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/27/21 + Time: 2:56 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + Login + + +

Log In

+<% + request.getParameter("username"); + request.getParameter("password"); +%> +

+ ${param.username} +

+

+ ${param.password} +

+ + +

Hello Admin, please login

+
+ + + + +

Sorry you're not an admin!

+
+
+
+
+ + +
+
+ + +
+
+ + + + +
+ + diff --git a/src/main/webapp/partials/body.jsp b/src/main/webapp/partials/body.jsp new file mode 100644 index 0000000000..f8963c452f --- /dev/null +++ b/src/main/webapp/partials/body.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/27/21 + Time: 4:12 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Body + + + + + diff --git a/src/main/webapp/partials/correct.jsp b/src/main/webapp/partials/correct.jsp new file mode 100644 index 0000000000..6d379125a6 --- /dev/null +++ b/src/main/webapp/partials/correct.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/28/21 + Time: 2:00 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Maybe it was luck, maybe it wasn't who knows? but you got it right ! + + + + + diff --git a/src/main/webapp/partials/footer.jsp b/src/main/webapp/partials/footer.jsp new file mode 100644 index 0000000000..b8ddf152dc --- /dev/null +++ b/src/main/webapp/partials/footer.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/27/21 + Time: 4:15 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Title + + + + + diff --git a/src/main/webapp/partials/head.jsp b/src/main/webapp/partials/head.jsp new file mode 100644 index 0000000000..e2dff1d48e --- /dev/null +++ b/src/main/webapp/partials/head.jsp @@ -0,0 +1,16 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/27/21 + Time: 4:12 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Head + + + + + diff --git a/src/main/webapp/partials/incorrect.jsp b/src/main/webapp/partials/incorrect.jsp new file mode 100644 index 0000000000..c0696a6566 --- /dev/null +++ b/src/main/webapp/partials/incorrect.jsp @@ -0,0 +1,17 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/28/21 + Time: 1:58 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Sike! That's the wrong numba!! <br> + -SupaHotFire + + + + + diff --git a/src/main/webapp/partials/navbar.jsp b/src/main/webapp/partials/navbar.jsp new file mode 100644 index 0000000000..0f185869f2 --- /dev/null +++ b/src/main/webapp/partials/navbar.jsp @@ -0,0 +1,14 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/27/21 + Time: 10:39 AM + To change this template use File | Settings | File Templates. +--%> + \ No newline at end of file diff --git a/src/main/webapp/pickcolor.jsp b/src/main/webapp/pickcolor.jsp new file mode 100644 index 0000000000..0aa1235d99 --- /dev/null +++ b/src/main/webapp/pickcolor.jsp @@ -0,0 +1,21 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 6/1/21 + Time: 11:13 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Pick Color + + +

Choose a color to turn your page to!

+
+ + + +
+ + diff --git a/src/main/webapp/pizza-order.jsp b/src/main/webapp/pizza-order.jsp new file mode 100644 index 0000000000..f4154213b4 --- /dev/null +++ b/src/main/webapp/pizza-order.jsp @@ -0,0 +1,56 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 6/1/21 + Time: 10:22 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + Pizza Order + + +
+ + +
+ + +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + +
+ +
+ + + diff --git a/src/main/webapp/productIndex.jsp b/src/main/webapp/productIndex.jsp new file mode 100644 index 0000000000..418bd88433 --- /dev/null +++ b/src/main/webapp/productIndex.jsp @@ -0,0 +1,25 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 6/1/21 + Time: 10:00 AM + To change this template use File | Settings | File Templates. +--%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + View Products + + +

Here are all the products:

+ + +
+

${product.name}

+

Price: $ ${product.price}

+
+
+ + + diff --git a/src/main/webapp/profile.jsp b/src/main/webapp/profile.jsp new file mode 100644 index 0000000000..774653ace8 --- /dev/null +++ b/src/main/webapp/profile.jsp @@ -0,0 +1,20 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/27/21 + Time: 2:56 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ include file="partials/navbar.jsp" %> +<%@ include file="partials/head.jsp" %> +<%@ include file="partials/body.jsp" %> +<%@ include file="partials/footer.jsp" %> + + + Profile + + + + + diff --git a/src/main/webapp/viewcolor.jsp b/src/main/webapp/viewcolor.jsp new file mode 100644 index 0000000000..7dd23fe4cd --- /dev/null +++ b/src/main/webapp/viewcolor.jsp @@ -0,0 +1,17 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 6/1/21 + Time: 11:13 PM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + View Color + + + + + + diff --git a/src/main/webapp/welcome.jsp b/src/main/webapp/welcome.jsp new file mode 100644 index 0000000000..40f859add3 --- /dev/null +++ b/src/main/webapp/welcome.jsp @@ -0,0 +1,60 @@ +<%-- + Created by IntelliJ IDEA. + User: Kelvon + Date: 5/27/21 + Time: 9:58 AM + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + + + Welcome, Marco + <%--must remember to not have any servlets listening on root --%> + + + +<%@ include file="partials/navbar.jsp" %> +<% int counter = 0; %> + <% counter++; + request.setAttribute("age",24); + request.setAttribute("numbers",new int[] { 1,2,3,4,5,6}); + %> + +

Hello, Marco

+ +What is 1+1? <%= 1+1 %> would be the answer. + +

This page was requested using the method <%=request.getMethod()%>

+

Path: <%=request.getRequestURL()%>

+

Name of parameter in query string <%=request.getParameter("name")%>

+

name: ${param.name}

+ +

Kelvon is ${age} years old

+
This page has been viewed <%=counter %> times
+ +<%----%> +<%-- Neopets for the win!--%> +<%----%> + +<%----%> +<%--

You really should go find stuff

--%> +<%-- Google--%> +<%--
--%> +
    + +
  • Item number ${number}
  • +
    +
+ + + Neopets for the win! + + + Google + + + + + +