CGS4854 Homework 1
Due Friday, 2/8 (late 6am, 2/9)
You are to create a service oriented web site. You will be adding features
throughout the semester. The type of service that you provide is your choice.
For example, the site that was developed in the book kept track of a user's
hobby and aversion. Try to be creative in picking your site. There are already
enough book sellers on the web and one site that keeps track of hobbies is
enough.
Choose a service that interests you.
Later in the course, you will be adding additional fields to this
site for an integer, a floating point number and a calculation using
these numbers. Think of a site that will be able to be expanded in
this way.
On each page of the application, add interesting information about your site.
Each page must have different information about the site. The information must
not be about how to navigate to the next page.
Create a Web Application using NetBeans
Create a new web application in NetBeans, named your-username
(replace your-username with your user name).
- If there is not a web.xml file in the WEB-INF folder, then select
New File -> Web -> Standard Deployment Descriptor (web.xml)
from the NetBeans menu.
- Use the secure web.xml file.
- Restrict access to this web site to you and me (this is controlled by
the secure web.xml file)
- Edit the tomcat users
file so that you can access your app in your local NetBeans.
- Add a folder named styles in the root folder (Web Pages folder in NetBeans).
- Add a stylesheet to the folder.
- 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.
- Modify the index.jsp that is in the root of the web app.
- Be
sure it uses the Doctype and Meta tags for HTML 5.
- Add a paragraph of at least four sentences that describes the service
that you are providing.
- Validate the JSP at http://www.w3c.org.
- Use the stylesheet in the page.
- Add a relative, hypertext link to the controller, so I can see it easily.
- Add a relative, hypertext link to the style sheet, so I can see it easily.
JSP Controller
Implement a JSP controller for your application. The controller
should behave like the JSP controller from Chapter 2 of the book.
- All the JSPs in the application, except the controller, should use the stylesheet. On each page, except the controller, add interesting information about your site.
Each page must have different information about the site. The information must
not be about how to navigate to the next page.
- Modify Edit.jsp. Instead of the Hobby property that is used in the book,
use three properties of your choice. These properties should be useful
in the web site that you are developing.
- Do not use first name and last name. Be creative.
- Think of a web site that you would like to create and pick three
properties that are specific to that type of service.
- Later in the course, you will be adding additional fields to this
site for an integer, a floating point number and a calculation using
these numbers. Think of a site that will be able to be expanded in
this way.
- The user will enter data into the field in the Edit page. Initialize
the input elements with the corresponding data in the query string.
In addition to the Edit, Confirm and Process pages,
create another JSP that will also display the data that is sent to it.
- Name the page WishList.jsp.
- The wish list page will display the data from the fields that are
sent to it, but will not let the user edit them. Eventually, this is a
page where users will be able to store information, without purchasing
it.
- Add an appropriate description to this page for your web application.
If you do not have a good description, then you will lose points.
- Add buttons to the wish list page that can send the user's data back
to the edit page or to the confirm page. Do not add a button for the
process page.
- Add a button to the confirm page that can send the user's data to the
wish list page. This is a new button, in addition to the edit and
process buttons. Do not add a button to either the Edit page or the
Process page for the WishList page.
Echo the value of the fields in the Confirm, Process and WishList
pages.
The web app must use the secure web.xml file and should only allow
you and me to access your application: Edit tomcat users
After the app is running in NetBeans, upload it and run it on ocelot: Uploading a WAR file
ROOT Web Application on ocelot
If you have not received your Tomcat host number, please create your webapps on ocelot and request a host number.
After you have created the ROOT and manager web apps on ocelot, you will need to create an index.jsp file in the ROOT web app. This will be the welcome page for your host on ocelot. It should have links to the manager web app and the username web app. If you have done the extra credit, then also include a link to the extra credit web app.
Be sure you have the following links in the ROOT/index.jsp file on ocelot.
- Relative link to manager/html.
- Relative link to the root of your web application for homework.
- Relative link to the root of your web application for extra credit (if you have one).
Hand In Assignment
To hand in the assignment, 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.