The J2EE BookShop A detailed walk through of the J2EE BookShop.

Slides:



Advertisements
Similar presentations
Struts Portlet Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Advertisements

Apache Struts Technology
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
Advanced Java Server Pages An more detailed look at JSPs.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
An introduction to Java Servlet Programming
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
DT211/3 Internet Application Development
Point Of Sale(POS) J2EE Application Department : Computer Science Degree : Master Student : Woojin Choi ID : (POS J2EE Application with JRun)
1 Build a Web Application on J2EE. 2 J2EE Scenario Client – Web Server – EIS Resources Client – Web Server – EIS Resources Client – Application Server.
DT228/3 Web Development JSP: Directives and Scripting elements.
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,
Apache Struts Technology A MVC Framework for Java Web Applications.
ECE356 – Database Systems Lab 1 – Building a Web Project with NetBeans Tiuley Alguindigue Lab Instructor – University of Waterloo, E & CE Dept. Fall 2013.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
Eclipse is an open source IDE (Integrated Development Environment) for developing applications in Java, C/C++, HTML, Cobol, Perl, etc. The official Eclipse.
1 Guide to JSP common functions 1.Including the libraries as per a Java class, e.g. not having to refer to java.util.Date 2.Accessing & using external.
Struts. Agenda Preface Struts and its components An example The architecture required for Struts Applications.
UNIT-V The MVC architecture and Struts Framework.
DSpace XML UI Project Texas A&M University Digital Initiatives, Research and Technology Scott Phillips, Cody Green, Alexey Maslov, Adam Mikeal, Brian Surratt,
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
JSP Standard Tag Library
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Chapter 16 The World Wide Web Chapter Goals Compare and contrast the Internet and the World Wide Web Describe general Web processing Describe several.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
CPS120: Introduction to Computer Science The World Wide Web Nell Dale John Lewis.
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Jonathan Westlake, ed: Nic Shulver JSP, Structure and JavaBeans JSP models Assignment context “Register as a member of the site/show member details/update.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
JavaServer Faces Jeff Schmitt October 5, Introduction to JSF Presents a standard framework for building presentation tiers for web applications.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
SHOPPING CARTS CHAPTER 19. E-COMMERCE Typically, an e-commerce site will have public pages and admin pages.
Java Server Pages A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format,
COMP 321 Week 7. Overview HTML and HTTP Basics Dynamic Web Content ServletsMVC Tomcat in Eclipse Demonstration Lab 7-1 Introduction.
JSP Most of the web developers deploying web applications using servlets mixes the presentation logic and business logic. Separation of business logic.
Standalone Java Application vs. Java Web Application
CSCI 6962: Server-side Design and Programming Java Server Faces Components and Tags.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
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,
JSTL, XML and XSLT An introduction to JSP Standard Tag Library and XML/XSLT transformation for Web layout.
J2EE Overview Web Programming CSCI J2EE multi-tier architecture Servlet: Java class loaded into Web server JSP page: enhanced HTML page that is.
JSTL Lec Umair©2006, All rights reserved JSTL (ni) Acronym of  JavaServer Pages Standard Tag Library JSTL (like JSP) is a specification, not an.
MSF Design Example Conceptual Design Logical Design Physical Design.
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
Chính phủ điện tử TS. Phạm Văn Tính Khoa CNTT, ĐH Nông Lâm TP.HCM
Apache Struts. J2EE Web Application using MVC design pattern Why MVC? Separate components = easier maintenance – Model component holds object data – View.
How I spend my money Software architecture course Mohan, Maxim.
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.
Java Enterprise Edition Programming Page 1 of 9Configuring Servlets Web Application Context Name  In multiple web applications, a “context name” is used.
JSP Server Integrated with Oracle8i Project2, CMSC691X Summer02 Ching-li Peng Ying Zhang.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Chapter 6 Chapter 6 Server Side Programming (JSP) Part 1 1 (IS 203) WebProgramming (IS 203) Web Programming.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Apache Struts Technology A MVC Framework for Java Web Applications.
J AVA T RAINING IN A HMEDABAD By TOPS Technologies 1 TOPS Technologies Java Course.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
Distributed Web Systems Cookies and Session Tracking Lecturer Department University.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 9 Case Study.
Struts 2 Development. Topics  Roles in Struts Development  Control Flow  Actions  Struts 2 Views and Target  Struts 2 Custom Tags  Validation 
Point Of Sale(POS) J2EE Application
Java Servlets.
Knowledge Byte In this section, you will learn about:
Design and Maintenance of Web Applications in J2EE
Building an Integrable XBRL Portal Daniel Hamm German Central Bank
Presentation transcript:

The J2EE BookShop A detailed walk through of the J2EE BookShop

Functional Requirements - repetition The Bookshop is a web shop where the customer can do the following  Customers should log into the system  Customers should be able to browse through all available books  Customers should be able to view detailed information about a particular book

Functional Requirments - repetition  Customers should be able to add and remove books from their shopping cart  When customers want to checkout their order, they should supply shipping information  When checking out, the order should be written in the ORDER table and the different books in the ORDER_ITEMS table

Technical Requirments - repetition Use MVC, Model View Controller The result return from beans or servlet should be XML that’s transformed to HTML with XSLT (use the JSTL tag library). Never print HTML in the beans or the Servlets. Output in JSPs are acceptable Try use a Custom tag, for example to return the shopping cart

Fundamental design ideas The book shop uses these fundamental design ideas  Model View Controller (MVC) is used as the base  All requests should be handled by a single controller servlet  Standard J2EE Security is used to secure the site We don’t implement the security, we only tell the system to use it  All dynamic content should be returned to the view as XML  All XML is transformed into XHTML with XSLT

Fundamental design ideas Static layout can be performed in the JSP pages for simplicity Only control logic in the controller servlet All business logic in Java Beans All presentation logic in JSPs and XSLT The shopping cart is accessed through a Custom Tag

Fundamental design ideas Environment variables (like JDBC Url and the different JSP pages) should be configurable at deploy time, i.e. should be defined in web.xml

web.xml One servlet  Named Shop and mapped as /shop  se.upright.education.uu.pvk.assignmenttwo.servle ts.ShopServlet Five init-param entries  JDBC_URL  CHECKOUT_PAGE  SHOW_PAGE  THANKYOU_PAGEDETAIL_PAGE

web.xml Three Tag Libraries  JSTL – core c.tld  JSTL – xml x.tld  BookShop bookshop.tld

web.xml The URL-pattern /* is secured Only users in the role tomcat is allowed Form-login is used  login.jsp is the login form  login_error.jsp is the error page in case of a login failure

web.xml TheShop /* tomcat NONE FORM /login.jsp /login_error.jsp

Database access All database access is handled by two beans  BookListBean  OrderBean The book list is only fetched once and then added to the application context  Bad performance to get the list for each request  Unnecessary memory usage if each user have a book list of their own  Read-only data

BookBean A JavaBean that represent one book All properties of the book available with getXXX() and setXXX() methods getXml() returns the book in XML format

BookListBean The implementation of the book list A Collection with BookBeans is the actual list When created, the BookListBean() connects to the database and fetches all books getXml() returns the entire book list as XML getXml() uses BookBean.getXml() to build it’s XML representation

ShoppingBean The implementation of the shopping cart Each user should have his own instance of the shopping cart addBook(book, quantity) adds a book to the cart  If the exists in the cart, only increase the quantity removeBook(id, quantity) removes a book  If the quantity to remove is more or equal to the present, remove the book, otherwise decrease the quantity in the cart

ShoppingBean getCart() returns the Collection that holds the actual cart getXml() returns the shopping cart as XML clear() removes all books from the cart

OrderBean Used to create a new order based on the shopping cart and the shipping information entered by the user The order is written to the ORDER-table The different books are written to the ORDER_ITEM table Explicit transaction handling is used  Inserting an order is one operation  Each book is one operation  All operations in one transaction, i.e. write the order and all books, or write nothing

ShopingCartTag The implementation of the Custom tag to output the shopping cart Uses ShoppingBean.getXml() to get the cart

XML – the book 1 Javaprogramming Fredrik Alund Bla bla bla

XML – the book list 1 Javaprogramming Fredrik Alund Bla bla bla 2 Javaprogramming2 Kalle Svensson Bla bla bla

XSL files booklist_xsl.xslt  Format the book list  BookListBean.getXml() bookdetail_xsl.xslt  Format the details about a particular book  BookBean.getXml() shoppingcart_xsl.xslt  The shopping cart shown in the show page  ShoppingBean.getXml() shoppingcart_checkout_xsl.xslt  The shopping cart shown in the checkout page  ShoppingBean.getXml()