You are on page 1of 32

AJAY KUMAR GARG ENGINEERING

COLLEGE
GHAZIABAD,UTTAR PRADESH
NAME : Anubhav Gautam

ROLL NO : 1802710023

TRAINING : JSP with Struts

PROJECT : Library Management System


INDEX
1. About the training
2. What is JSP?
3. JSP Life Cycle
4. JSP Architecture
5. JSP Elements
6. Exception Handling
7. What is Struts?
8. Mini Project (Online Library Management System)
About the training
JSP with struts is a 4 week training course which
covers jsp and struts technology used for web
development.
JSP is a technology for developing web pages that
supports dynamic content. This helps developers
insert java code in HTML pages by making use of
special JSP tags. Struts is a popular and mature web
application framework.
1. What is JSP?
JSP stands for Java Server Pages is a
technology for building web applications that
support dynamic content and acts as a Java
servlet technology.

● JSP is Server-side scripting language:


Server-side scripting means that the JSP
code is processed on the web server
rather than the client machine.

● JSP is used to build dynamic web


applications.

● JSP is an improved extended version


of Servlet technology.
2. JSP Life Cycle
A JSP page life cycle is defined as a process from its translation
phase to the destruction phase. The life cycle of a JSP page can be
divided into the following phase:
➢ Translation Phase
➢ Compilation Phase
➢ Initialization Phase
➢ Execution Phase
➢ Destruction(Cleanup) Phase
3. JSP Architecture

JSP architecture is a 3 tier architecture. It has a Client, Web Server, and Database. The
client is the web browser or application on the user side. Web Server uses a JSP Engine
i.e; a container that processes JSP. JSP Engine intercepts the request for JSP and
provides the runtime environment for the understanding and processing of JSP files. It
reads, parses, build Java Servlet, Compiles and Executes Java code, and returns the
HTML page to the client. The webserver has access to the Database.
4. Elements of JSP
● JSP Declaration <%! declarations %>

● JSP Directive <%@ directive %>

● JSP Scriplet <% scriplets %>

● JSP Expression <%= expression %>

● JSP Comment <%-- Set of comment statements --%>


JSP Declaration : - As the name suggests, it is used to declare methods and variables to be used in
Java code within a JSP file. According to the rules of JSP, any variable must be declared before it can be
used.
JSP Directive : - These tags are used to provide specific instructions to the web container when the
page is translated.

JSP Scriplet : - The scriptlet tag allows writing Java code statements within the JSP page. This tag is
responsible for implementing the functionality of _jspService() by scripting the java code.

JSP comments : - JSP comments marks text or statements the web container should ignore

JSP Expression : - Expressions elements are responsible for containing scripting language expression,
which gets evaluated and converted to Strings by the JSP engine and is meant to the output stream of the
response.
Exception Handling
In, JSP there are two ways to perform
Servlet Exception Handling, An
exception handling.
Servlet Exception Handling can be
defined as an event which will be 1. By errorPage and isErrorPage
occurring while the program executes attributes of page directive.
Exception is a common problem while
executing the programs so where 2. By <error-page> element in
developer will use to try and catch web.xml.
blocks to resolve the error.
What is Struts?
Struts is an open source framework that
extends the Java Servlet API and
employs a Model, View, Controller
(MVC) architecture. It helps in creating
maintainable, extensible, and flexible
web applications based on standard
technologies, such as JSP pages,
JavaBeans, resource bundles, and
XML.

Story for illustration purposes only


PROJECT
ONLINE LIBRARY
MANAGEMENT SYSTEM
The purpose of the project is to
build an application program to
reduce the manual work for
Aim of the project managing the address, member,
librarian and student. It manages
all the information about books,
issue dates, student, book number,
book name, author etc. The
project is totally built at
administrative end and thus only
the administrator is guaranteed
the access.
UML Diagrams Of the Project
For Better Understanding

State Chart Diagram


Use Case Diagram

Admin
Class diagram
Activity Diagram
Code of the Project-
Project Snapshots

Login
Page
On entering login On entering wrong
details login details
Admin can create staff Admin can browse staff details
Admin can delete any staff Admin can Browse books
Fill Book details and after that it looks
like this:
Login as a library member.

Incorrect
details
Member can search for
books
Member can issue books
Normal visitors can only see the
book details.
THANK YOU.

You might also like