Skip to content

Lab 3-1 – Your first JSP

Instructions

  1. Create an html file named myFirstJSP.jsp and save it to your projects/public_html directory.
  2. Add some normal HTML content so that the page looks like it belongs to your site.
  3. Add an image to the page.
  4. Add the following line of code somewhere on the page:

    <%= new java.util.Date() %>
    
  5. Add a link to your home page that goes to this JSP page.

  6. Run $ ant on the command line to deploy your web app.
  7. Start Tomcat and click on the link to view myFirstJSP.jsp.
  8. Make sure you see the correct timestamp.
  9. Now look at the generated java source code from the directory tomcat/work/Catalina/localhost/java112/org/apache/jsp/.

    See the below video for instructions on saving your tomcat directory to your codespace workspace and easy access to the tomcat directory.

    Save Tomcat directory in Codespaces

  10. Make a change to the JSP page (not the generated java source code).

  11. Run $ ant on the command line to deploy your web app.
  12. Access the changed version of the page with the browser.
  13. Go back to your editor and see what happened!

Screenshots

To receive credit for this lab save these screenshots in the projects/screenshots/week8 directory.

You may combine the below into one screenshot and name it lab1.png.

  1. lab1-jsp.png: The myFirstJSP.jsp running in the browser.
  2. lab1-generated-code.png: The generated java source code. Just include the top of the file if it is very long.

Submit Weekly Labs

  1. Add, commit, and push!
  2. Verify all work, including screenshots are visible in GitHub.
  3. Create a new issue in GitHub: "Week 8 ready for review".
  4. Copy the below text and paste it into the "Add a description" textarea. Answer the reflection questions in the space provided.

    @kkschumacher
    
    #### How are you doing? 
    **Are you encountering any issues preventing you from completing this week's assignments? What can I do to better support you this week?**
    
    #### What did you find particularly enlightening this week?
    
    
    #### What challenges (if any) did you encounter in your learning this week?
    
    
    #### What questions (if any) do you have about the material covered this week?
    
  5. Click "Submit new issue"


Rubric

All of the following must be satisfied to achieve a "Met" status

  • Screenshot clearly shows myFirstJSP.jsp running in the browser.
  • Screenshot of generated Java code is included.
  • Code and screenshot are properly named and saved in the correct directory.
  • All lab steps have been accurately and appropriately implemented.

Additional Considerations

  • Issue created correctly with thoughtful answers to the reflection questions.
  • Shortest relative path is used to link to the homepage.