CIS 1056 Advanced Web Technology and Programming - Syllabus Course Description Prerequisite: Grade of C or better in C+IN SC 1052 Introduction to Web Technology and Programming In this course, students learn basic object oriented programming and debugging techniques using web programming languages such as JSP, Java, SQL, HTML, CSS, and Javascript. This course will focus on fundamental programming concepts such as data types, type conversion, exception handling, assignment statements, methods, objects, conditions, and loops. In addition, students will learn how to use JSP implicit objects (request, out) and HTML/CSS for input and output, create and access a database (directly and through code), use JSP implicit objects (session, response) to provide user log-in and restricted page access. Students are expected to have prior knowledge of basic web design since HTML, CSS, and Javascript will only be reviewed briefly and not covered in any detail. Each student will create a very simple web application that (1) lists and inserts products, (2) lists and inserts users/customers, (3) provides log-in (4) restricts some pages to logged-in users. This course is intended for students in the Digital Media Minor. Textbooks and Resources Introduction to Java Programming, Comprehensive Version, 9/E Y. Daniel Liang, Armstrong Atlantic State University ISBN-10: 0132936526 ISBN-13: 9780132936521 Publisher: Prentice Hall Copyright: 2013 Format: Paper; 1344 pp Published: 03/02/2012 If you buy this online (e.g., amazon), you can get paperback version for about $120. The Temple bookstore offers a cheaper version for about $60 (pages to be placed in a 3 ring binder). Web references and other materials will be posted in blackboard blackboard.temple.edu Project and Labs Each student will create their own web application that reads from a database and offers some product for sale. Students will use development environments in our computing labs (e.g., NetBeans, MySqlWorkbench), but students will also receive instructions so that they may create these same (free/open source) development environments on their PCs at home. Each week, students will be given a small lab assignment that will enhance the functionality of their web application. Most lab assignments will provide sample code which serve to guide the students as they write (similar) code to enhance their web application. Since “doing” is critical to learning, lab assignments must be submitted each week (see late penalty policy below). If a student is unable to submit a lab, they should still complete the work since it will be re-graded as part of their final project. Students should be careful not to “over plan” and “under deliver” their web applications as this will result in late penalties and poor grades. Syllabus for CIS 1056 Advanced Web Technology and Programming Tentative list of Course Topics: A traditional java textbook will be utilized to provide adequate examples for fundamental programming constructs. Chapter 1 Introduction to Computers, Programs, and Java These chapters combined since JSPs will be used to gather text input & convert to numeric: o Chapter 43 JavaServer Pages (JSPs) o Chapter 2 Elementary Programming (and data types) o Chapter 9 Strings and Text I/O o Chapter 14 Exception Handling Chapter 3 Selections Chapter 4 Loops Chapter 5 Methods Chapter 8 Objects and Classes Chapter 10 Thinking in Objects Chapter 34 Java Database Programming Chapter 42 Servlets (very light coverage – definition only) Chapter 45 Web Services (very light coverage – definition only) For topics that are more specific to web application programming, tutorials and other web resources will be provided as reference. 2 Syllabus for CIS 1056 Advanced Web Technology and Programming Tentative Lab Content – check blackboard for latest info and dates. week Lecture Lab Title 1 Course Introduction. Development environment. JSP pages (server side dynamic creation of HTML page) and their relationship to HTML/CSS. Posting page to self, persistance of user input. Debugging tips for HTML layout, CSS styles, JSP compiler errors. How to use "view source" to ensure JSP page does not generate malformed HTML. index.jsp (hello) 2 Data type conversion, I/O, exception handling, assignment statement, conditional logic. JSP includes. Review TCP/IP (telnet, ftp). Debugging tips: out.print (display intermediate results on the HTML output), interpreting JSP exception errors that can show up on the web page, System.out.print (display intermediate results in the tomcat or Glassfish log). calculate 3 Classes. Static methods (that validate user input). methods Lab Description Install NetBeans at home. Create a JSP page that is targeted to sell some product (of your choice). The page will reference an external style sheet and include at least one image. The page layout (HTML/CSS) should have the normal areas: title (reflective of what you will be selling), nav bar (about 5-6 links, including "home", "products", "users", & "labs"), content (see next sentences), footer (your name included). In the content area, describe the products your site will be selling. Also in your content area, put a form with a text field for the user to enter their name and a submit button. When the user clicks submit, the page shall say hello to whatever name was entered. No need to publish this page, just attach files to blackboard (a zip file of your JSP project folder and a word doc with screen captures). Create page "calculate.jsp" (with same layout as index.jsp) that takes 3 or more inputs. When the user clicks submit, the input values shall persist and the page shall display a (single) calculated result. Your calculations must include conditional logic (if statement). If the user enters any non-numeric values, the page displays an error message (using exception handling). Make sure to include user instructions telling what to input and what calculations will be performed. The calculations that you select can be anything you like (and does not have to be related to the overall topic of your website). Use JSP include statements so that common areas of your web pages are stored in separate files (e.g., title, nav bar, footer, etc). Create page "labs.jsp" (referenced by Add a link from labs.jsp to this page (calculate.jsp). For this homework and every subsequent homework, publish your site and attach files to blackboard (zipped project folder and word doc with screen captures). Create a page "methods.jsp". Convert your calculation from previous lab into a static method (of a java class). Incorporate use of (given) Validation class with static methods. Your page "methods.jsp" should function exactly the same as last week's "calculate.jps", but most of the code will be in java classes, not JSP page. For this lab and every subsequent lab, add a link from the top of your content area of your labs.jsp to the page of that week's homework. So, for this week, the link is from labs.jsp to methods.jsp. 3 Syllabus for CIS 1056 Advanced Web Technology and Programming 4 Objects. Properties, non-static methods. objects Create a "Department" class with properties: Department_Name (String), Number_of_employees (integer), Total_Salary (integer) and another property of your choice. Add two constructor methods: a default constructor that sets department name to ", number of employees and total salary both to 0 (decide how to set your property) and a second constructor that takes the name of the department (and possibly your property - you decide). For both constructors all class properties must be set to something. Add getter methods for all properties. Add a setter method for department name (and for your added property), but not for number of employees or total salary. Add method "employ" that takes the salary of the new employee (adds 1 to number of employees, adds the new salary into the total salary). Add method "fire" that takes the salary of the employee to be fired (subtracts 1 from number of employees, subtracts the given salary from the total salary. Add method: getAvgSalary() that tells the average salary. Create "objects.JSP" that displays and allows users to invoke methods on 2 different Department objects. 5 Databases. database 6 Display data: database connections, more exception handling, loops. Show products 7 more practice with databases, exception handing, use of classes (e.g., db connection class, class to generate HTML from DB data), conditional logic, loops. Calc products Create database with two tables: "product" and "web_user". Certain fields in each table will be required, but each student will add 2 of their own fields to the product table (one must be nullable and noncharacter). Populate the database with data (at least 5 -10 records per table). Create a word document "database.doc" that shows your work (includes screen captures). Add a link from labs.jsp to this document ("database.doc"). Incorporate sample code "show_users.jsp" (shows all the users from database table web_user) into your web app. Create your own JSP page "show_products.jsp" that shows all the data from your product table. Data should be displayed in a HTML table. No need to use classes. Your nav bar "users" shall link to "show_users.jsp" and "products" shall link to "show_products.jsp". Create page "calc_products.jsp" that functions like last week's "show_products.jsp", except that the code is moved from the JSP page into java classes: db connection clas and ProductSql. Class ProductSql shall have a displayAll () method that generates HTML Table (String) containing all the products from the database (using HTML table). Enhance method displayAll() so that it adds a calculated field to each product row you are displaying. This calculated field needs to use conditional logic (IF statement). Your nav bar "products" shall now link to this page "calc_products.jsp". Validate product Into your web app, incorporate sample code "validate_user.jsp" and related java classes. Create "validate_product.jsp" and associated classes ("Product", "ValidateProduct") to validate a new product. For this week, user data will not actually be inserted into the database, only checked to determine if it will be accepted by the database or not. Add a link from (the top of) page show_users.jsp to validate_user.jsp. Add a link from (the top of) page calc_products.jsp to validate_product.jsp. 8 object composition. Validation. 4 Syllabus for CIS 1056 Advanced Web Technology and Programming Insert product Into your web app, incorporate sample code "insert_user.jsp" plus related java classes. To class ProductSql, add a method insert() that takes a ProductValidate object and a database connection object and inserts the validated product into the database. Create a page "insert_product.jsp" that allows a user to insert a product record into the database (by using the classes just mentioned). From the top of "show_users.jsp" and "calc_products.jsp" add links to "insert_user.jsp and insert_product.jsp (respectively). 10 database delete, use of javascript from JSP pages. Debugging tips: hover over link to ensure any (JSP produced) HTML link is well formed -- or "View Source". Javascript debugging - use alert to display intermediate results. If javascript has syntax or runtime error, it just stops executing. Delete product Into your web app, incorporate sample code that deletes a web user from the database. Start out with a copy of calc_products.jsp (page that lists all products). Add delete icon to every product record (with call to delete javascript function). 11 session, response.redirect () login 9 Database prepared statement (Insert). Add username/pw logon functionality to index.jsp page. Password protect some pages with response.redirect() Course Policies and Procedures Labs are typically introduced during the lecture prior to the lab. Although there may be some additional instruction at the beginning of lab, the labs are mainly self-directed with help available. The lab handout will be posted in Blackboard. DO NOT WORK AHEAD since labs may be changed right up to the lecture where they are introduced. The details of each lab assignment can be found in blackboard. At the end of each lab, there are instructions for submission which usually includes that you attach a zip file of all your source code right into the blackboard assignment (where the instructions were) AND publish to your website. Grading typically consists of testing your work from your website and reviewing the code as submitted into blackboard. Lab homework is due midnight before the next lab (unless otherwise specified). Late penalties are based on time of submission into blackboard. Lab homework submitted after the deadline (up to 1 week late) gets a 20% late penalty. Lab homework is not accepted after that. If you start working on your homework the day before it is due, you will probably miss the deadlines. IT IS IMPERATIVE that you ask for help if you find that you are not working effectively on your lab homework. At the beginning of lab each week there will be a QUIZ. o The quiz will cover the previous week’s lab. Prepare for this by studying the previous lab handout and reviewing the assignment you just submitted (from last lab). o The quiz may also cover any material presented in lecture. Prepare for this by attending lecture, taking notes, and reviewing materials posted in blackboard. o Quizzes cannot be made up and if you arrive late, you will not be awarded extra time. However, since every student will have the occasional issue, the lowest 2 quiz grades will be dropped. If you attend each lab and study for each quiz, you can use your 2 drops to cancel out your poorest grades (instead of cancelling out 0s for when you missed lab). o Quizzes are weighed heavily. It is a quick feedback mechanism (for me and for you) – to ensure that you are keeping up and learning the necessary material. 5 Syllabus for CIS 1056 Advanced Web Technology and Programming In lab, after you finish taking the quiz, start right away working on the lab. Don’t expect to complete your lab homework during lab, but try to finish your lab homework as soon as possible afterwards (you might need to ask for help). Please NOTE the instructions on how to move your web application from one computer to another (for example, from your home computer to a lab computer). It’s not a word document that can be easily moved around and edited. It is a web application that needs to be “deployed” onto the destination computer. Students who don’t follow these instructions have many problems trying to work in the labs (and deploying to their web site). The computer labs in Wachman Hall are NOT open 24 hours 7 days a week. Learn the lab hours and adjust your schedule accordingly. If you prefer to work from home, it is your responsibility to set up your own development environment there, but I will help you as much as I can. Most students who do not promptly set up a web development environment at home do not do well in the course. Attendance: If you must miss lecture or lab, check Blackboard to see what material was presented and ask your classmates about anything else that may have been discussed. Communication: Please contact me as soon as possible if you think you are running into difficulties. Ask me, or your lab instructor, or another student for help AS SOON AS POSSIBLE. Disability Disclosure: Any student who has a need for accommodation based on the impact of a disability should contact me privately to discuss the specific situation as soon as possible. Student must provide me with a note from the office of Disability Resources and Services (100 Ritter Annex, 215-2041280). Academic Honesty and Ethics: Temple University and I expect you to observe the highest ethical standards. When working in the lab or on your project, you may consult others, but the work you submit must be your own. Never share your answers with others. Never accept answers from others. Unless otherwise directed, all quizzes are closed book, closed computer. All violations of academic honesty will be handled according to university policy. Tentative Grade Weights Lab Homework Final Web Project Weekly Quizzes (lowest 2 dropped) Final Exam 25% 25% 25% 25% 100% Grade Scale 95-100 90- 94 87- 89 83- 86 A AB+ B 80-82 77-79 73-76 70-72 BC+ C C- 6 67-69 63-66 60-62 0-60 D+ D DF