Homework, Year 2

The focus of this homework will be setting up the Intellij spark web project

If you run into errors please try the following :
Rebuild the project. It should be under the Build tab up top.
Google error messages
Email me with what specifically is not working

The goal of this homework will be downloading a pre-setup web project I made for you all

To start, download the zipped project

Next, drag the zip file someplace safe on your computer. You will need it again.

Now, unzip the zip file someplace that you will remember. Maybe a folder called "Projects"

Next, you have to open the project using intellij. Launch intellij and then go to File->Open

Navigate to the unzipped folder. This is your project. Select the project's folder and press open

Now that you have the project open in Intellij, you should be able to run the project (I hope!)

This is where you might run into problems. If the project won't run for whatever reason, try to fix it!
Do not give up! This is part of the homework

If you are able to run the project successfully, you should get a lot of red text that says things like this :


[Thread-0] INFO org.eclipse.jetty.util.log - Logging initialized @208ms to org.eclipse.jetty.util.log.Slf4jLog
[Thread-0] INFO spark.embeddedserver.jetty.EmbeddedJettyServer - == Spark has ignited ...
[Thread-0] INFO spark.embeddedserver.jetty.EmbeddedJettyServer - >> Listening on 0.0.0.0:4567
[Thread-0] INFO org.eclipse.jetty.server.Server - jetty-9.4.6.v20170531
[Thread-0] INFO org.eclipse.jetty.server.session - DefaultSessionIdManager workerName=node0
[Thread-0] INFO org.eclipse.jetty.server.session - No SessionScavenger set, using defaults
[Thread-0] INFO org.eclipse.jetty.server.session - Scavenging every 600000ms
[Thread-0] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@1f36d7f{HTTP/1.1,[http/1.1]}{0.0.0.0:4567}
[Thread-0] INFO org.eclipse.jetty.server.Server - Started @326ms

Go to your web browser on your computer and type in http://localhost:4567/
This make a request to your web server! No one else will be able make request to your
web server yet because you have firewalls protecting your computer IE: no port forwarding set up.
But that's ok! Now you can start work on your dynamic web application.

Modify the code so that when a request is made to the server it returns a different web page.
Please, get creative with this part.

Extra Credit : Modify the code for the server so that it returns a randomly generated web page with each request! Use a java.util.Random for a random number generator for example.