OOSSE Week 8 JSP models Format of lecture: Assignment context JSP models JSPs calling other JSPs i.e. breaking up work Parameter passing JSPs with Add.

Slides:



Advertisements
Similar presentations
Michelle Johnston, Firebird Services Ltd
Advertisements

Java Script Session1 INTRODUCTION.
CS4273: Distributed System Technologies and Programming I Lecture 11: JavaServer Pages (JSP)
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Chapter 51 Scripting With JSP Elements JavaServer Pages By Xue Bai.
Using JavaServer Pages Harry R. Erwin, PhD CIT304/CSE301.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
J4www/jea Week 3 Version Slide edits: nas1 Format of lecture: Assignment context: CRUD - “update details” JSP models.
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
DT228/3 Web Development JSP: Directives and Scripting elements.
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
1 CS6320 – JSP L. Grewe 2 Java Server Pages Servlets require you to write out entire page delivered with print statements Servlets require you to write.
Q: According to Intel, the Pentium conforms to the IEEE standards 754 and 854 for floating point arithmetic. If you fly in aircraft designed using a Pentium,
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems JavaServer Pages (JSP)
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Java Enterprise Edition Java Web Development Structure of a web project Introduction to Web Applications The first project Introduction to Java Web Development.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
1 CIS336 Website design, implementation and management (also Semester 2 of CIS219, CIS221 and IT226) Lecture 9 JavaServer Pages (JSP) (Based on Møller.
Java Server Pages CS-422. What are JSPs A logical evolution of java servlets –most servlets dynamically create HTML and integrate it with some computational.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans JSP models Assignment context “Register as a member of the site/show member details/update.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
JSP Java Server Pages Softsmith Infotech.
Chapter 7 Java Server Pages. Objectives Explain how the separation of concerns principle applies to JSP Describe the operation and life-cycle of a JSP.
Introduction to JavaServer Pages (JSP) Slides from Dr. Mark Llewellyn.
Java Server Pages Lecture July Java Server Pages Java Server Pages (JSPs) provide a way to separate the generation of dynamic content (java)
 Embeds Java code  In HTML tags  When used well  Simple way to generate dynamic web-pages  When misused (complex embedded Java)  Terribly messy.
JSP Most of the web developers deploying web applications using servlets mixes the presentation logic and business logic. Separation of business logic.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Stanisław Osiński, 2002JSP – A technology for serving dynamic web content Java Server Pages™ A technology for serving dynamic web content Stanisław Osiński,
JAVA SERVER PAGES CREATING DYNAMIC WEB PAGES USING JAVA James Faeldon CS 119 Enterprise Systems Programming.
16-Oct-15 JSP Implicit Objects. 2 JSP Implicit Objects are the Java objects that the JSP Container makes available to developers in each page and developer.
Introduction to JavaServer Pages. 2 JSP and Servlet Limitations of servlet  It’s inaccessible to non-programmers JSP is a complement to servlet  focuses.
Chapter 6 Server-side Programming: Java Servlets
Chapter 7 Being a JSP. JSP introduction JSP is a solution for two issues  Servlet is difficult for HTML designers since they may not know Java  Formatting.
JSP Fundamentals Elements of a JSP Using Beans with JSP Integrating Servlets and JSP.
Jsp (Java Server Page) Is a server side program.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Java Server Pages (JSP)
Java Server Pages An introduction to JSP. Containers and Components Several clients – one system.
3/6/00jsp00 1 Java Server Pages Nancy McCracken Northeast Parallel Architectures Center at Syracuse University.
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Basic JSP Celsina Bignoli Problems with Servlets Servlets contain –request processing, –business logic –response generation all lumped.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
OOSSE Week 7 Java Server Pages Format of lecture: Introduction What are Java Server Pages? (JSPs) What do you need to run JSPs? Demo of an example of a.
Core basic Java web server technologies. Tools Eclipse IDE for Java EE Developers (Netbeans also works) nloads/packages/eclipse-
CSI 3125, Preliminaries, page 1 JSP (Java Server Pages)
1 Java Server Pages A Java Server Page is a file consisting of HTML or XML markup into which special tags and code blocks are inserted When the page is.
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
JSP in Action. JSP Standard Actions forward, include, useBean, setProperty, getProperty, text, element, and plugin Additional actions param, params,
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Unit-6 Handling Sessions and Cookies. Concept of Session Session values are store in server side not in user’s machine. A session is available as long.
Apache Struts Technology A MVC Framework for Java Web Applications.
Net-centric Computing Servlets & JSP. Lecture Outline  Tracking Sessions  Cookies  Examples  JSP  Differences between JSP and Servlets  JSP Constructs.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Distributed Web Systems Cookies and Session Tracking Lecturer Department University.
Java Server Pages By: Tejashri Udavant..
Java Servlets.
Struts BY: Tejashri Udavant..
Presentation transcript:

OOSSE Week 8 JSP models Format of lecture: Assignment context JSP models JSPs calling other JSPs i.e. breaking up work Parameter passing JSPs with Add SQL examples Summary Version 1.1 Nov 2009 Slide 1

OOSSE Week 8 Assignment context What have you got to develop? To answer this ….You need to study the assignment specification carefully – the wording is deliberate “Development of Application (20%) The site requires a Java Application that will allow the user to do the following based on the above scenario: - Register as a member of the site/show member details/update member details Enter an order Update an order View orders Delete orders” Slide 2

OOSSE Week 8 Assignment Context Register as a member of the site/show member details/update member details Can you do this? YES with JSPs from last week and this week Add JSP View JSP Update JSP Slide 3

OOSSE Week 8 Assignment Context Enter an order Update an order View orders Delete orders Can you do this – yes but hold on a minute – what do the actions above imply? Ans: A shopping cart…..rather than build your own….use one that is already available …..Mal’s E-Commerce Slide 4

OOSSE Week 8 Anything else Yes ….How to store the orders that members make…in a database We can use Access to store members details via our JSPs But for orders is that necessary? So search for OO add on functionality…the result? mOrders – free download Slide 5

OOSSE Week 8 Version 1.0 Nov 2007 Slide 6

OOSSE Week 8 Version 1.0 Nov 2007 Slide 7

OOSSE Week 8 JSP Built-in Objects JSPs have access to several objects that we can use when processing a request from a browser and then generate a dynamic response. There are eight in all: requestout responsepagecontext sessionapplication configpage Slide 8

OOSSE Week 8 Built-in objects You will see these objects being used in the examples provided Request objects methods allow us to access information about: The user HTTP headers Client’s machine Request URL and parameters. Slide 9

OOSSE Week 8 Built-in objects Response objects methods allow access to: Setting HTTP headers Set cookies Encode session information into URLs Version 1.0 Nov 2007 Slide 10

OOSSE Week 8 Built-in objects Out object - has methods to generate and control output to the browser PageContext object - has page attributes Page object - represents the servlet instance i.e. the object generated from having compiled the JSP Application object - used for extracting information about the lifecycle of the Servlet Version 1.0 Nov 2007 Slide 11

OOSSE Week 8 Reminder - The Structure of JSPs An initial selection of tags to get to know (Scriptlet Tags = v. important!!!) Used for embedding blocks of Java code into JSPs Scriptlets provide control structures like decision (if and switch) and iteration control structures (for and while) Version 1.0 Nov 2007 Slide 12

OOSSE Week 8 Structure of JSPs Declaration Tags – also important. Used for declaring variables and methods. For example: <%!public String whereFrom(HttpServletRequest req) { ses = req.getSession(); return req.getRemoteHost(); } %> Version 1.0 Nov 2007 Slide 13

OOSSE Week 8 Structure of JSPs Expression Tags Used for inserting the value of a Java expression into JSPs e.g. Version 1.0 Nov 2007 Slide 14

OOSSE Week 8 Structure of JSPs Directive Tags – used to provide information to the JSP server. There are three directives: page include taglib We will only review the page and include directive Page Directive - used to set properties of the JSP. E.g. what packages it imports from the Java library or is an error page e.g. Version 1.0 Nov 2007 Slide 15

OOSSE Week 8 JSP Action Tags – Useful for assignment Action tags are used to perform actions when a JSP page is requested by a browser There are six JSP action tags: useBean setProperty getProperty Include Forward plugin We will review the following two: forward – this week (week 8) Include – next week (week 9) Version 1.0 Nov 2007 Slide 16

OOSSE Week 8 forward Action Used to forward the request to another JSP – see diagram on next page This will forward the current request object to the specified file When a forward tag is encountered, the JSP engine doesn't process the remainder of the current JSP file Anything that has been written into the output buffer by the current JSP file will be lost Version 1.0 Nov 2007 Slide 17

OOSSE Week 8 Forward model lForward model Version 1.0 Nov 2007 Slide 18 JSP Client Request DATABASE The JSP parses the input from the client form and updates the database HTTP Server - Tomcat HTML Form SQL Response

OOSSE Week 8 Demos in jw5 server folder CRUD examples this week and next – Create(add);Retrieve(view/get); Adding information to a database Demo of a add JSP (addtousers.jsp) Retrieving (getting) information from the Guestbook database with JSPs Demo of a simple Get JSP (SimpleGetUserExample.jsp) Demo of a user input version of get (GetUserUsingInputExample.jsp) Slide 19

OOSSE Week 8 addtousers.jsp Version 1.0 Nov 2007 Slide 20

OOSSE Week 8 SimpleGetUserExample.jsp Version 1.0 Nov 2007 Slide 21

OOSSE Week 8 GetUserUsingInputExample.jsp Version 1.0 Nov 2007 Slide 22

OOSSE Week 8 InputGuestsv2.html – an HTML form that calls a JSP and then forwards back to another page Version 1.0 Nov 2007 Slide 23

OOSSE Week 8 Summary You have learnt more about the structure of JSPs Learning from examples is good You have seen an Add something JSP You have seen a more sophisticated view something JSP (compared to last week with the simple guest listing) You are now in a position to apply this knowledge to the assignment task Version 1.0 Nov 2007 Slide 24