Lab 3-1 – Your first JSP
Instructions
- Create an html file named myFirstJSP.jsp and save it to your projects/public_html directory.
- Add some normal HTML content so that the page looks like it belongs to your site.
- Add an image to the page.
-
Add the following line of code somewhere on the page:
<%= new java.util.Date() %>
-
Add a link to your home page that goes to this JSP page.
- Run
$ ant
on the command line to deploy your web app. - Start Tomcat and click on the link to view myFirstJSP.jsp.
- Make sure you see the correct timestamp.
-
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. -
Make a change to the JSP page (not the generated java source code).
- Run
$ ant
on the command line to deploy your web app. - Access the changed version of the page with the browser.
- 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
.
lab1-jsp.png
: The myFirstJSP.jsp running in the browser.lab1-generated-code.png
: The generated java source code. Just include the top of the file if it is very long.
Submit Weekly Labs
- Add, commit, and push!
- Verify all work, including screenshots are visible in GitHub.
- Create a new issue in GitHub: "Week 8 ready for review".
-
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?
-
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.