CGS4854 Extra Credit 3
Due Thursday, 9/19 (late 6 am, 9/20).
If you did not do Extra Credit 1, then create a web application named
Tutorials in NetBeans.
If you did Extra Credit 1, then add this tutorial to the same
Tutorials project from Extra Credit 1. Extra Credit 1 should remain intact in
the web application. There will be two links in the index page, one to Extra Credit 1 and the other to Extra Credit 3.
For the Tutorials project:
- Edit the tomcat users
file so that you can access your app in your local NetBeans. View a walk-through of editing the tomcat users file.
- Restrict access to this web site to you and me (this is controlled by
the secure web.xml file).
- Add a folder named styles in the root folder (Web Pages folder in NetBeans).
- Add a stylesheet to the folder. Be sure it has the .css extension.
- In the stylesheet, set the default background color and text color for the entire page.
- Use contrasting colors so the text can be read easily.
- Implement the Servlet Controller in the Tutorials web application. It
must work exactly like the example from the book. Step-by-step
instructions. View a walk-through for creating the servlet controller.
- The JSPs must be in a subfolder named ch2/servletController under Web Pages
in the Netbeans project.
- The servlet must be in a package named ch2.servletController in the Source
Packages in the Netbeans project.
- Create a servlet definition and mapping for the servlet in the web.xml file.
Do not use the
WebServlet
annotation for this tutorial.
If there is not a web.xml file in the WEB-INF folder, then select
New File -> Web -> Standard Deployment Desctiptor (web.xml)
from the NetBeans menu.
- Modify the index.jsp file in the web app as follows. If you have an index.html file instead of index.jsp, then follow this video to add an index.jsp as the default page: Changing the default index page
- Be sure that the index.jsp uses the DOCTYPE for HTML 5 and corresponding
meta tag for the charset.
- Add a hypertext
link in index.jsp to the URL for the servlet controller. If you did Extra Credit 1, then
you will have two links in this page, one for ec1 and one for ec2.
- Use a relative
reference from the current location.
- Do not link directly to a JSP.
- Add a hypertext
link in index.jsp to the URL for the style sheet.
- Use a relative
reference from the current location.
Use the style sheet in all the pages for the web application. Use a relative link from the current file for all href to the style sheet.
Validate all of the pages at w3.org, including the style sheet.
Clean and Build your web application.
In the operating system (not in NetBeans) navigate to the dist folder in the
NetBeans project.
Deploy the WAR file on ocelot: Deploy a WAR File
Create an index.jsp file in the ROOT web app on ocelot:
- Include all the standard tags for a web page.
- Add a hypertext link to the Tutorials web app.
- Use a reference that is relative to the current location.
- Create the link to the web app, not to the servlet controller.
Be sure to validate the page for correct HTML.
Hand In Assignment
To hand in the assignment, log onto ocelot, zip the cgs4854 directory and upload it.
- Please use the following command to compress your cgs4854
folder.
zip -r username ~/cgs4854 -x \*.jar \*.zip \*.war
Replacing username with your user name. This will create a file
named username.zip. It contains the ROOT, manager and username web
applications.
- Check the size of the ZIP file, it should be less than 3 MB. If it is
not, then you probably have another ZIP file stored in the ZIP archive.
Delete it and re-zip.
- You then have a choice for submitting the file.
- If you are logged onto ocelot, use my uploading program to upload the
file. Enter this command at the command prompt:
~downeyt/public/webftp/webftp.pl
- If you are using winscp, then download the zip file to your computer;
then, upload the file to me: Submitting
homework on-line via the Web.
- Upload the file as binary.
Be sure that all your files and subdirectories are included in the zip
file.
After uploading, do not modify your files on ocelot until after your assignment
has been graded.