Download presentation
Presentation is loading. Please wait.
Published byRoderick Wells Modified over 9 years ago
1
CS 160: Software Engineering August 27 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak www.cs.sjsu.edu/~mak
2
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak Reminders: By Friday, August 29 Form teams. Email me your team information. team name team members and email addresses 1-paragraph description of your team’s web application _ 2
3
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 3 “The Five C’s” Complexity Change Collaboration Communication Coordination
4
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 4 Software Engineering is … Team-based Processes Manage complexity Manage change. … team-based processes that manage complexity and change in order to successfully develop software products. Successful software products! }
5
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 5 Architecture of a Java Web Application Tomcat Microsoft Explorer Firefox Google Chrome Apple Safari MySQL Relational Database Manager Your work here! JSP, servlets, database tables, etc. Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
6
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 6 Take roll!
7
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 7 Basic HTML Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
8
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 8 Basic HTML Tags Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
9
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 9 Basic HTML Tags (cont’d) Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
10
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 10 Anchor Tags (Links) Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
11
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 11 Tables Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
12
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 12 Images Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
13
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 13 Cascading Style Sheets (CSS) Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
14
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 14 HTML Form Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
15
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 15 Text Controls Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
16
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 16 Text Areas Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
17
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak Check Boxes and Radio Buttons One button group Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
18
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak Combo Boxes The user can select only one option. AKA: drop-down menu 18 Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
19
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 19 List Boxes The user can select multiple options. Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
20
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak What is a Servlet? A servlet is a Java class that extends HttpServlet. Servlets reside on the server computer in a directory that is controlled by Tomcat. Recall that Tomcat is our JSP/servlet engine. A servlet object is invoked by a URL. URL = Uniform Resource Locator (i.e., a web address) Servlet objects run on the server computer. _ 20
21
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak What is a Servlet? cont’d When invoked, a servlet object can: Dynamically generate HTML that will be returned to the client as part of an HTTP response. Perform any application logic. Access the back-end database. Whatever – it’s Java code! _ 21
22
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 22 What is a JavaServer Page (JSP)? A JSP is a file that looks a lot like the HTML that the web server will return to the client as part of an HTTP response. JSPs reside on the server computer in a directory that is controlled by Tomcat. Special tags in the file represent where dynamically-generated content will appear. A plain HTML page is static. A JSP represents an HTML page that is dynamically generated.
23
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 23 What is a JavaServer Page? cont’d A JSP is invoked by a URL. The first time it’s invoked, a JSP is compiled by the JSP/servlet engine (e.g., Tomcat) into a servlet. A JSP is a much easier way to code a servlet whose main purpose is to return HTML to the client. JSPs are often coded by web page designers who know HTML but not Java. _
24
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 24 The Tomcat Server Chapter 2 of the book Java Servlets and JSP does an excellent job of explaining how to download, install, and use Tomcat. Recommendation: Follow the book’s instructions precisely regarding user names and passwords, otherwise some of the examples may not work. First learn how to use Tomcat by itself. Local URL for the default page: http://localhost:8080/ http://localhost:8080/
25
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 25 The Tomcat Server, cont’d In Chapter 3, you’ll learn how to run Tomcat from within the NetBeans IDE while you’re developing and debugging JSPs and servlets. _
26
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 26 Tomcat’s Directory Structure On the server computer: During development, your laptop can be both the client computer and the server computer. Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
27
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 27 Tomcat’s Directory Structure, cont’d Murach’s Java Servlets/JSP, 2 nd ed. © 2008, Mike Murach & Associates, Inc.
28
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 28 Manually Deploy a Web Application A web application is packaged as a.war file Web archive file, similar to a.jar file The NetBeans IDE will create.war files for you. To deploy a web application manually, copy its.war file into Tomcat’s webapps directory. Tomcat will automatically expand the.war file into a subdirectory structure and enable users to access the application’s web pages. Demo
29
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 29 Tomcat’s Web Application Manager Manage your web applications start stop reload deploy undeploy Manager URL: http://localhost:8080/manager/html http://localhost:8080/manager/html Demo
30
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 30 NetBeans Chapter 3 of the book Java Servlets and JSP does an excellent job of explaining how to download, install, and use NetBeans. Download from: https://netbeans.org/downloads/index.html https://netbeans.org/downloads/index.html You want the Java EE version. Edit, debug, and run web applications. Similar to Eclipse Integrated with Tomcat
31
Computer Science Dept. Fall 2014: August 27 CS 160: Software Engineering © R. Mak 31 NetBeans When you install NetBeans, be sure to specify that you want to include Apache Tomcat. Otherwise, you’ll get the GlassFish server instead.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.