You are on page 1of 15


Presentation On JSP & Online Shopping Cart


What is JSP?

Mostly HTML page, with extension .jsp Include JSP tags to enable dynamic content creation Translation: JSP Servlet class Compiled at Request time (first request, a little slow) Execution: Request JSP Servlet's service method

Jsp architecture
response response Client


Jsp Engine & Web-server

Jsp File





Data passed between client & server

Why JSPs?

Goal: Create dynamic web content (HTML, XML, ...) for a Web Application Goal: Make it easier/cleaner to mix static HTML parts with dynamic Java servlet code JSP specification ver. 2.0 Java Servlet specification ver. 2.4


Code -- Computation HTML -- Presentation Separation of Roles

Developers Content Authors/Graphic Designers/Web Masters Supposed to be cheaper... but not really...

Action Elements

Standard Actions Custom Actions

Standard Actions
<jsp:getProperty> Gets a property value from a JavaBeans component and adds it to the response <jsp:setProperty> Set a JavaBeans property value <jsp:include> Includes the response from a servlet or JSP page during the request processing phase <jsp:forward> Forwards the processing of a request to servlet or JSP page

Custom Actions (Tag Libraries)

Can Define Your own! Description

Define Install Declare Use

Shopping Cart Application

The Shopping Cart application enables an end user to search a specific book in an online data base, place an order for it and also purchase it online.

The application also enables you to manage a data stored in a database for the online displayed books, such as: adding a book, adding a book category, modifying the book information.

To create the Shopping Cart application, we have used: JSP as server side scripting language, JavaScript for client side data validations, HTML for data display, Oracle as the database to store information.

Database Connectivity
Step1: loading a database driver Step2: creating a oracle jdbc connection Step3: creating a JDBC statement object Step4: executing a SQL statement with the statement object, and returning a JDBC result.

The Information Rule Guaranteed Access Rule Systematic treatment of null values The database catalog must be relational too The system must implement a comprehensive data sublanguage Data views must be updatable

High level insert,update and delete Physical data independence Logical data independence Integrity independence Entity integrity Refrential integrity Distribution independence Nonsubversion

Thank You.!