All Parts due: Sunday, March. 15, 2015 11:00 PM |
Please note the hard submission deadline. No submission will be accepted after 2 day of deadline even you have more grace period left, 11:00PM.
Submission deadline: Programming work is submitted electronically and must be submitted by the deadline. However, we recognize that there might be last minute difficulty during submission process, so as long as you started your submission process before 11:00PM, you have until 11:55PM to completely upload your submission. After 11:55PM, you will have to use grace period as follows.
Late Policy: Since emergencies do arise, each student is allowed a total of four unpenalized late days (four periods up to 24 hours each) for programming work, but the final assignment can be more than two days late. If you "run out of" your grace period, you will get penalized 25% for 1 day delay, and you will be penalized 50% for 2 day delay. No programming work will be accepted more than 48 hours late (48 hours is a hard deadline). Because of the coming of final week, any submission after 11:00PM on Tuesday (03/17/2015) won't be accepted unless special approval from professor "before" the deadline. Again, 48 hours after the due date is an absolute hard deadline, and any submission after that will be rejected. (That is, 0 points)
Honor Code reminder: For more detailed discussion of the Honor Code as it pertains to CS144, please see the Assigned Work page under Honor Code. In summary: You must indicate on all of your submitted work any assistance (human or otherwise) that you received. Any assistance received that is not given proper citation will be considered a violation of the Honor Code. In any event, you are responsible for understanding and being able to explain on your own all material that you submit.
Reminder:
In Project 4, you developed search and browse interfaces to help users access items on eBay. In this project, you extend your Project 4 to allow users to pay for an item by inputting their credit card number. Before you move on, read the following two tutorials to learn how to enable SSL on tomcat and how to keep information through a sequence of pages using http session:
Your task for this part of the project is to enable the following sequence of steps on your tomcat server to obtain the user's credit card number:Transaction workflow
ItemServlet
class in Project 4) if the item has "Buy_Price",
you should display a "Pay Now" link. Basic requirements
You may think that you can meet the above requirements simply by (a) encrypting every communication between the tomcat server and the user's browser with HTTPS and (b) obtaining Buy_Price directly from oak whenever it is displayed to the user. Unforutnately things are a bit more comlicated due to a few additional preformance-related constraints. We refer to the following figure to illustrate these constraints and data flow among the machines.
Important constraints
Note that if you want to encrypt a communication from the browser to the server through SSL, you simply need to make the beginning of the request URL "https://..." (as long as the URL has the correct port number for the SSL connection). Then both the request to and the response from the server will be encrypted. If you want to make sure that your communication is not encrypted, start your request URL with "http://...". You may find the following methods of the HttpServletRequest class helpful to avoid hardcoding the server name and the path at which your page will be deployed: getServerName(), getServerPort(), getContextPath(), isSecure().
Since you will need to enable SSL on tomcat, you will need to modify server.xml in /etc/tomcat7/ as well. When you enable SSL, make sure that you enable it at the port 8443 (the default value given in the existing server.xml file).
Other Notes
This project is an extension to your Project 4, so your submission zip file project5.zip should include all your files for Project 4 and a few additional files that you implemented for Project 5. The structure of the submission zip file should be essentially the same as that of Project 4 as we show here:
project5.zip
|
+ README.txt
+ build.xml
|
+ WebContents
| + any Web files (*.html, *.jsp, *.css, *.js, image files)
| + WEB-INF
| + web.xml
+ src
| + java source codes for the servlet (with your own naming/structure)
|
+ lib
+ external java libraries used (not available in our VM)
In the README file, please include the answers to the following questions: (A succint answer is enough. Please limit your answer to 100 words per question.)
Please make sure that the build.xml in the zip file have the target
"build" that builds your web site into a single eBay.war file, and the
target "deploy" that deploys that .war file on the Tomcat server pointed to by
the environment variable $CATALINA_BASE
. That is, we should be
able to simply unzip your submission and run "ant build" and "ant deploy" to
deploy your web site on our machine.
Your final submission should include all files to make your Web site up and running. Add any additional notes or comments that you think will be helpful to the README.txt file.
As always, remember to allow sufficient time to prepare your submission once your work is complete.
cs144@cs144:~$ ./p5_test project5.zipAdd the path to the zip file if necessary after downloading the script and setting its permission appropriately.
You MUST test your submission using the script before your final submission to minimize the chance of an unexpected error during grading. When evertything runs properly, you will see an output similar to the following from the grading script:
Stopping tomcat server if it is running...After you run the script, make sure to check the functionality of your site using the Firefox browser in the VM and stop the Tomcat server when you are done.
Running 'ant build' to build your war file...
... output from ant ...
Removing existing eBay application files on Tomcat...
Deploying your eBay application...
... output from ant ...
Now your Tomcat server is running with your application.
Please access your application through your browser.
Make sure that all application functionalities are working fine.
Don't forget to stop Tomcat server once you are done.
Once your submission file project5.zip is ready, submit via CCLE.