Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans JSP models Assignment context “Register as a member of the site/show member details/update.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Apache Struts Technology
DT211/3 Internet Application Development JSP: Processing User input.
How to Make a Web Page: A Crash Course in HTML programming.
PHP (2) – Functions, Arrays, Databases, and sessions.
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.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
Java Server Pages B.Ramamurthy. Java Server Pages Servlets are pure Java programs. They introduce dynamism into web pages by using programmatic content.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Tutorial Introduction Fidelity NTSConnect is an innovative Web-based software solution designed for use by customers of Fidelity National Title Insurance.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Java Server Pages (JSP) Presented by: Ananth Prasad & Alex Ivanov May 10, 2001.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Java Beans.
Server-side Scripting Powering the webs favourite services.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Introduction to the WebBoard Terry Dennis. The WebBoard - Our Connection The WebBoard URL is
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
NMED 3850 A Advanced Online Design January 12, 2010 V. Mahadevan.
Website Development with PHP and MySQL Saving Data.
Caching Chapter 12. Caching For high-performance apps Caching: storing frequently-used items in memory –Accessed more quickly Cached Web Form bypasses:
CHAPTER 7 Form & PHP. Introduction All of the following examples in this section will require two web pages. The first page retrieves information posted.
Web Programming Brian Toone 8/27/2014. Outline for today 1.Understanding the architecture of the web 2.Overview of programming languages – Client-side.
Microsoft FrontPage 2003 Illustrated Complete Creating a Form.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Registration Solutions for your Event Management.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
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.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
DT228/3 Web Development JSP: Actions elements and JSTL.
Apache Struts Technology A MVC Framework for Java Web Applications.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Introduction to Dynamic Web Programming
Data Virtualization Tutorial: Introduction to SQL Script
Introduction and Principles
PHP / MySQL Introduction
Cookies BIS1523 – Lecture 23.
Chapter 27 WWW and HTTP.
Tutorial 6 PHP & MySQL Li Xu
Enterprise Java Beans.
Retrieving information from forms
Presentation transcript:

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans JSP models Assignment context “Register as a member of the site/show member details/update member details” JSP models JSPs calling other JSPs i.e. breaking up work JSPs with Update SQL examples Summary Assignment Progress review – making sure you are clear about what you are doing with the prototype Java Beans – notes

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans The update problem How to tackle for the assignment? What do we need to do? Understand the SQL Solution using the Guests example We need to allow the user to select a guest record Let the user view it Allow the user to modify it (not key however) and then write it back to the database i.e. update it Are there any aspects we don’t wish to allow the user to do? Yes – they cannot alter the key, in this case both the address and lastname

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans The update solution So, we need… The form that calls a jsp which simply displays the result from the fetch in a set of text boxes rather than a table format this allows the user to do something with the data We can allow the user to change the content of the text box for firstname and then call a jsp to do the update to the database then call another jsp to display the confirmation or return to our starting point

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans UPDATE SQL A JSP which can use the parameters from the update form and call a JSP to update the database Use the Update SQL command to modify existing records in a table UPDATE table_name SET column1=value, column2=value2,... WHERE some_column=some_value See:

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Demo Now follows We’ve put the example in a folder on nas1/examples called updateguestexamples_withoutbean Guests.html Guests.html

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Your assignment You can use the same approach to modify and update a member entry in the database

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Summary You have seen a simple JSP update example JSPs may be linked and embedded This type of web design starts to look like a service oriented structure i.e. JSPs that will service other JSPs or HTML forms given the appropriate information

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Assignment progress You should have by now thought of a sequence of events that the prototype needs to follow ……your work in UML should help you with this Use Case Script The membership aspect you can tackle with the JSPs we have reviewed over the last two weeks …add a member; view and update a member How much detail do we need to hold about a member? address; name ….do we need anything else?

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Orders Process You need to understand how the 3rd party shopping cart works – what will it accept? …true OO – we don’t need to know how it is built but need to know what parameters to send it What do we need to send the shopping cart? The product selected by the member; and other information …product desc; price

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Assignment progress So how to do this? There needs to be a member login form where we check they are a member….if yes they get directed to a product page……that is what the membership is for – to allow access – see following example which you will need to augment……..

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Assignment progress What should the product page be? Choices here ….it could be a simple static HTML page which shows products with buy now buttons A buy now hypertext link to the shopping cart 3rd party software….example on next slide Your page would just have a few example CDs or DVDs to demonstrate the proof of concept How the buy now button links to the shopping cart is explained in the Mal’s E-Commere help but we will show you on the screen to be clear

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Assignment Progress

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Assignment Progress Alternative to the HREF example is to use a FORM using POST instead of GET What this means is you link to the cart using a HTML form instead of an ordinary hyperlink. You can add something to the cart using a drop down list, radio buttons or any HTML form tag.

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Assignment Progress Alternatively you could do a more sophisticated product page….but you have not been requested to do this. This would involve a products table A form which retrieves the products and shows them to the user …very similar to the update guest example The user then selects a product to buy The difference with this solution would be that the products displayed would be dynamic i.e. from the database

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Orders – use of shopping cart Add order – via shopping cart. An order can be for more than one item Deleting orders – via shopping cart – just make sure all quantities are zero and this will empty the shopping cart Update order – via shopping cart – change quantity or remove item by zero quantity

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Java Beans What now follows are notes and a demo of component technology …called Java Beans No need to do this for the assignment (purely optional) but an understanding is necessary for the exam The “OO ness” of Beans is the interesting aspect

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Java Server Pages and beans! The “N-Tier” model Introduction to JavaBeans How JSP and JavaBeans can work together Demo

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans The N-tier model Up to know we have used 2 tier i.e the client (presentation) and the http server (JSP application) For N-tier - where we are heading? - we will use our HTTP server for java beans and JSPs N-tier means separation of data; application logic; presentation – Why is this good software engineering? Discussion …….. We can introduce JavaBeans as a tier - the JSP will “talk to” the bean and the bean can handle for example access to a database Beans can be used by many JSPs for common functionality and can help to slim down the JSP code Therefore, what are JavaBeans? They can be thought as “middleware” but we need more detail than that……

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Java Beans – a definition JavaBeans are a portable, platform independent component model written in the Java programming language, developed in collaboration with industry leaders, e.g. IBM. Circa They enable developers to write reusable components once and run them anywhere, benefiting from the platform independence power of Java technology. See the JavaBeans homepage link below for more info Java beans are useful and at Enterprise level they are called Enterprise Java Beans (EJBs)

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans JavaBeans – “nuts and bolts” A JavaBean is developed as a.java file extension It HAS to be compiled into a.class file extension The name of the Bean MUST match the name of the class The Bean cannot be run standalone - it has to be called by another Java program - in our case a JSP the JavaBean has no main method (therefore it cannot run on its own accord) it can have variables and methods which can be called by another Java program – in our case a JSP

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans JavaBeans – objects A JavaBean is a Java class, a blueprint that represents some real-world entity that we wish to model in our system. It specifies the structure of the data for the entity and a series of methods (functions) that can act upon that data. To work with a class in our code, we build an object from the class. This is like building an office block from the blueprint. So, on the server we could have many objects of the JavaBean class in existence (i.e. my use of the JavaBean would create an object, another user’s use of the JavaBean would create another object – two separate objects that share a similar structure). Therefore we can conclude that JavaBeans can be used in a multi-user environment.

Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans Summary It should have struck you by now that a JavaBean can be used by many JSPs - this is good practice. For example, the GuestBean can service a number of different JSPs. a JSP to add Guests. a JSP to delete Guest. How? Answer - by providing a method which the JSPs can call.