Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.

Similar presentations


Presentation on theme: "CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson."— Presentation transcript:

1 CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson

2 CIS 285 ROBINSON WINTER 2005 Course Objectives Create attractive Web sites that include graphics, forms, tables & form validation Understand the JavaScript/HTML Object model Use Cookies to access Web applications Construct and use JavaServer Pages and integrate Java Beans Construct and launch Java Servlets from HTML and JavaServer Pages

3 CIS 285 ROBINSON WINTER 2005 Course Objectives Use JDBC to retrieve, insert and update data in a back end database from a Web page Generate dynamic Web pages using JavaServer Pages, JavaBeans, Java Servlets, JDBC and XML Understand the model-view-controller (MVC) Design, create and deploy a small e-business Web-site using all the tools taught in the class Introduce “Best Practices”

4 CIS 285 ROBINSON WINTER 2005 Course Progress Class attendance Labs & Projects Assignments Exams Contacting the instructors

5 CIS 285 ROBINSON WINTER 2005 Introduction Name and organization Object-oriented programming experience HTML, XHTML, XML, JavaScript background Java, WebSphere Studio Application Developer or other IDE experience

6 CIS 285 ROBINSON WINTER 2005 Agenda – 4 Jan 2005 General Web Architecture Web Evolution Server-Side Technologies Servlet / Java Server Page (JSP) Lab Exercise (HTML) Lab Assignment

7 CIS 285 ROBINSON WINTER 2005 Class #1 Objectives: Define the stages of Web application development Discuss static content - HTML Dynamic content – client-side Dynamic content – server-side Create an HTML page Instructions for Lab #1

8 CIS 285 ROBINSON WINTER 2005 General Web Architecture Web server requests a Web page from a Web server Web server locates requested page Web server could process some code in the requested page Web server send page to the client that requested it

9 CIS 285 ROBINSON WINTER 2005 Client / Server Model Data Layer Database Legacy Store Business Logic Separates execution of tasks evenly (goal) Makes optimal use of resources Based on the distribution of the components, N-tier client-server models have been developed Presentation Logic

10 CIS 285 ROBINSON WINTER 2005 Two Tier Client / Server Architecture Database Server Accesses database Issues queries Return results to client Presentation Logic Business Logic Database Management

11 CIS 285 ROBINSON WINTER 2005 Three Tier Client / Server Architecture Database Server Presentation Logic Database Management Application Server Business Logic ClientApplication ServerDatabase Send request to application server Access database and issue queries Send and display results Business logic manipulates query result

12 CIS 285 ROBINSON WINTER 2005 Web Application – Static Server Client Web Browser Web Server File System HTTP Request HTTP Response Network

13 CIS 285 ROBINSON WINTER 2005 Web Application – Static Pages Content exists before the page is requested User requests a page via URL into the browser, and the request is sent from the browser to the Web server via HTTP (HTTP request) Web server receives the request (via HTTP) and locates the.htm /.html page in file system Web server sends HTML stream (response) back across the Internet (via HTTP) to client browser Browser interprets the HTML and displays the page

14 CIS 285 ROBINSON WINTER 2005 Web Application – Dynamic Client-Side Server Client Web Browser JVM & JScript, JS (Interpreters) Web Server File System HTTP Request HTTP Response Network

15 CIS 285 ROBINSON WINTER 2005 Web Application – Dynamic Client - Side Content (some or all) does not exist before a page is requested Content can be improved with client-side programs such as: JavaScript, VBScript, JScript, Applets Browsers must provide the appropriate interpreter to execute scripting code (Browser Dependent) All browsers come with built-in engines – not all have the same engines ( Ex. Netscape cannot interpret VBScript or JScript) Examples: Current time on your system

16 CIS 285 ROBINSON WINTER 2005 Web Application – Dynamic Client - Side 2 Notes on Applets: Have security constraints which restrict access to back-end systems Web browser (or JDK’s appletviewer) uses the HTML document to locate the applet’s byte code files on the Internet or the system’s hard drive HTML file must contain an tag Web browser will then load the JVM, which will load applet’s code into memory – interpret and execute it

17 CIS 285 ROBINSON WINTER 2005 Web Application – Dynamic Server-Side Server Client Web Browser Web Server File System (URL) HTTP Request HTTP Response Network Server-side Script Business Logic Access database Result Server-side Program Dynamic Req Static Req

18 CIS 285 ROBINSON WINTER 2005 Web Application – Dynamic Server - Side Content (some or all) does not exist before a page is requested Server-side scripts are executed on the server Content can be improved with server-side programs such as: CGI, ASP, ASP.NET, JSPs (Servlets) – different ext. Servers must be equipped with an engine that can interpret the corresponding scripting code Server-side scripts have Nothing to do with client browsers

19 CIS 285 ROBINSON WINTER 2005 Server–Side Application Notes For CGI, ASP & ASP.NET CGI Compiled, runs fast Difficult to modify and update (recompile program) Not convenient to connect to database Security issues – poor code and tainting ASP ASP script is contained within HTML tags Using Active control and DLL ASP script itself needs to be interpreted every time it is requested ASP.NET Overcomes drawbacks discussed above Limited support - primarily used on Windows platform

20 CIS 285 ROBINSON WINTER 2005 Web Application – Servlets Server - Side ServerClient Web Browser Web Server Plug-in Web Container HTTP Request HTTP Response Web Server File System Network Static Resource Requests Dynamic Resource Requests Dynamic Response

21 CIS 285 ROBINSON WINTER 2005 Web Application: Servlets Servlets are small Java programs that run on a Web server in response to client requests Servlets generate dynamic content that is sent back to client Servlets are compiled and represented as.class files Servlets are loaded either on demand or by the server at start-up When a servlet is requested from client, a method or function is called in response to the request

22 CIS 285 ROBINSON WINTER 2005 Web Application: Servlets Once a servlet has been loaded, it remains in memory until the server decides to remove it or the server is shutdown. A servlet is loaded either at start-up or upon the first client request to it, and after that, every time a client makes a request to the servlet, the server merely runs a method within the servlet. This dramatically reduces the response time experienced by client. Servlets are completely written in Java. Platform independent, server-side modules (components) that are download, on demand, by the system that needs these application components.

23 CIS 285 ROBINSON WINTER 2005 Web Application: Servlets Many major software vendors currently provide native support for servlets and JSP within their product: IBM WebSphere server BEA WebLogic Application Server Netscape Enterprise Server Servlet and JSP engines: JRUN from Live Software ServletExec from New Atlanta Communications Apache Tomcat from the Apache Software Foundation Support many popular Web servers including Microsoft Internet Information Server (IIS) and Apache (HTTP)

24 CIS 285 ROBINSON WINTER 2005 Web Application – Servlets ServerClient Web Browser Web Server Plug-in Web Container HTTP Request HTTP Response Web Server File System Network Static Resource Requests Dynamic Resource Requests Dynamic Response

25 CIS 285 ROBINSON WINTER 2005 Servlet Problem When a JSP page is requested, the first time, it is compiled into its corresponding servlet Servlets give poor separation between business logic and presentation logic If this servlet is responsible for handling all corresponding requests and content from the browser, then the HTML and other content must be embedded in the Java code: A Java editor must be used Code must be produced by a Java developer Application flow and presentation may be “colluded” - limiting reuse, maintenance becomes difficult, and parallel development may be limited or not even possible

26 CIS 285 ROBINSON WINTER 2005 Web Application: Servlet Problem Web Container Request Response Servlet RequestDispatcher – not being utilized service (req, res) methods() forward (req, res) service (req, res)

27 CIS 285 ROBINSON WINTER 2005 Web Application Solution for Servlets – JSP Evolution Web Container Request Response Servlet RequestDispatcher JavaServer Page JavaBean service (req, res) methods() forward (req, res) methods()

28 CIS 285 ROBINSON WINTER 2005 JSP Benefits Uses HTML / XML tags that encapsulate the logic that generates the content for the page Application logic can reside on other servers – separation of logic from display Formatting tags are passed to the response page Can use JSP technology without having to learn the Java language – ease of administration

29 CIS 285 ROBINSON WINTER 2005 JSP Benefits Separates the page logic from its design and display Supports a reusable component-based design – Web-based applications can be built quickly Extension of Java Servlet technology Platform independent, enhanced performance, extensible and easy to use.

30 CIS 285 ROBINSON WINTER 2005 J2EE Architecture Diagram Java 2 Platform Enterprise Edition Specification, v1.4 11/24/03 Shannon

31 CIS 285 ROBINSON WINTER 2005 Resources http://www.w3.org/MarkUp/ http://www.w3.org/MarkUp/Guide/ http://validator.w3.org/ http://www.w3.org/TR/html401/index/elements.html http://java.sun.com/products/jsp/overview.html http://www.course.com/catalog/downloads.cfm?isbn=0- 619-06343-2 http://www.brainopolis.com/jsp/book/jspBook_Architecture s.html

32 CIS 285 ROBINSON WINTER 2005 Questions?


Download ppt "CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson."

Similar presentations


Ads by Google