SlideShare a Scribd company logo
Strut2-Spring-Hibernate
Get Trained on:
Workshop Agenda
Day 1
1.Understanding Struts2
2.Architecture of Struts2
3.Features of Struts2
4.Environment Setup
5.Understanding Configuration of Project
Day 1 Continue
6.Practical Lab
7.Introduction to Hibernate
8.Demo of Struts2 Application
Understanding Struts2
•Apache Struts 2 is an elegant, extensible framework for
creating enterprise-ready Java web applications.
•The framework is designed to streamline the full
development cycle, from building, to deploying, to
maintaining applications over time.
•To make web development easier for the developers.
MVC Design Pattern
Architecture of Struts2
What kind of MVC is Struts2
Struts 2 is pull MVC
Request Life Cycle
• User sends a request to the server for requesting for
some resource (i.e pages).
• The FilterDispatcher looks at the request and then
determines the appropriate Action.
• Configured interceptors functionalities applies such as
validation, file upload etc.
• Selected action is executed to perform the
requested operation.
• Again, configured interceptors are applied to do any
post-processing if required.
• Finally the result is prepared by the view and returns
the result to the user.
Features of Struts2
• POJO forms and POJO actions
• Tag Support
• AJAX Support
• Easy Integration
Features continued…
• Template Support
• Plugin Support
• Profiling
• Easy to modify tags
• Promote less configuration
• View Technologies (JSP, Velocity, Freemarker,etc)
Environment Setup
4 Simple Steps:
•Step 1 - Setup Java Development Kit (JDK)
•Step 2 - Setup Apache Tomcat
•Step 3 - Setup Eclipse (IDE)
•Step 4 - Setup Struts2 Libraries
Understand Configuring
Project
4 Simple Steps
•Create an Action Class
•Create a View
•Create a launch page
•Now configure all of them
Create an Action Class
public class Student
{
private String fullName;
public String execute() throws Exception {
return "success";
}
public String getFullName() {
return name;
}
public void setFullName(String name) {
this.name = name;
}
}
Create View
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Welcome to Team Go Getters</title>
</head>
<body>
Hello,
We are glad to have <s:property value=”fullName"/> as our
student.
</body>
</html>
Create a launch page
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Struts2 Workshop</title>
</head>
<body>
<h1>Welcome to Team Go Getters</h1>
<form action=”welcome">
<label for="name">Please enter your name</label><br/>
<input type="text" name=”fullName"/>
<input type="submit" value=”Enroll"/>
</form>
</body>
</html>
Configuration Files
Struts.xml file
•Mapping between URL ,Action classes and Result Types
(View)
•Since Struts 2 requires struts.xml to be present in classes
folder.
• So create struts.xml file under the WebContent/WEB-
INF/classes folder.
Struts.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name=”workshop" extends="struts-default">
<action name=”welcome"
class="com.teamgogetters.struts2.Employee"
method="execute">
<result name="success">/Welcome.jsp</result>
</action>
</package>
</struts>
Multiple struts.xml files
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration
2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="my-struts1.xml"/>
<include file="my-struts2.xml"/>
</struts>
Web.xml
• Entry point for any request to Struts 2
• Mapping FilterDispatcher
• Deployment Descriptor
• Security Parameters
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>Struts 2</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Interceptors
• Providing preprocessing logic before the action is
called.
• Providing post-processing logic after the action is
called.
• Catching exceptions so that alternate processing can
be performed.
List of Interceptors
• timer
• params
• checkbox
• createSession
• logger
• fileUpload
• scope
• alias
Snippet
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<package name=”workshop" extends="struts-default">
<action name=”welcome"
class="com.teamgogetters.struts2.Employee"
method="execute">
<interceptor-ref name="params"/>
<interceptor-ref name="timer" />
<result name="success">/welcome.jsp</result>
</action>
</package>
</struts>
Result and Result Types
• <results> tag plays the role of a view in the Struts2 MVC
framework. The action is responsible for executing the
business logic. The next step after executing the business logic
is to display the view using the <results> tag.
• Struts comes with a number of predefined result types and
whatever we've already seen that was the default result type
dispatcher, which is used to dispatch to JSP pages. Struts
allow you to use other markup languages for the view
technology to present the results and popular choices include
Velocity, Freemaker, XSLT and Tiles.
Snippet
<result name="success" type="dispatcher">
<param name="location">
/HelloWorld.jsp
</param >
</result>
<result name="success" type="freemarker">
<param name="location">
/hello.fm
</param>
</result>
<result name="success" type="freemarker">
<param name="location">
/hello.fm
</param>
</result>
Practical Lab
JDBC is going obsolete?
• Complex if it is used in large projects
• Large programming overhead
• No encapsulation
• Hard to implement MVC concept
• Query is DBMS specific
What’s Next ?
Hibernate: ORM
• Hibernate is a high-performance Object/Relational
persistence and query service
• Hibernate takes care of the mapping from Java classes to
database tables
• Hibernate data query and retrieval facilities
ORM New Generation
1. Let business code access objects rather than DB tables.
2. Hides details of SQL queries from OO logic.
3. Based on JDBC 'under the hood’
4. No need to deal with the database implementation.
ORM New Generation…
5. Entities based on business concepts rather than
database structure.
6. Transaction management and automatic key
generation.
7. Fast development of application.
Visual presentation of
Hibernate
Hold your breathe till
tomorrow
Demo
Ad

More Related Content

What's hot (20)

Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014
Stéphane Bégaudeau
 
Backbone js
Backbone jsBackbone js
Backbone js
Rohan Chandane
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
Ojdbc
OjdbcOjdbc
Ojdbc
Art Saucedo
 
5 angularjs features
5 angularjs features5 angularjs features
5 angularjs features
Alexey (Mr_Mig) Migutsky
 
AngularJS introduction
AngularJS introductionAngularJS introduction
AngularJS introduction
Tania Gonzales
 
Intro to React
Intro to ReactIntro to React
Intro to React
Eric Westfall
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
Odoo Experience 2018 - Develop an App with the Odoo Framework
Odoo Experience 2018 - Develop an App with the Odoo FrameworkOdoo Experience 2018 - Develop an App with the Odoo Framework
Odoo Experience 2018 - Develop an App with the Odoo Framework
ElínAnna Jónasdóttir
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architecture
Michael He
 
AngularJS Basic Training
AngularJS Basic TrainingAngularJS Basic Training
AngularJS Basic Training
Cornel Stefanache
 
The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
Boyan Mihaylov
 
An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications
Rohan Chandane
 
Planbox Backbone MVC
Planbox Backbone MVCPlanbox Backbone MVC
Planbox Backbone MVC
Acquisio
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
Omnia Helmi
 
SUGCon 2014 Sitecore MVC
SUGCon 2014 Sitecore MVCSUGCon 2014 Sitecore MVC
SUGCon 2014 Sitecore MVC
mikeedwards83
 
Advance java session 13
Advance java session 13Advance java session 13
Advance java session 13
Smita B Kumar
 
Backbone to React. What it says about awesome UI Code.
Backbone to React. What it says about awesome UI Code.Backbone to React. What it says about awesome UI Code.
Backbone to React. What it says about awesome UI Code.
Richard Powell
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!
Muhammad Ghazali
 
ASP.NET Routing & MVC
ASP.NET Routing & MVCASP.NET Routing & MVC
ASP.NET Routing & MVC
Emad Alashi
 
Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014Modern Web Application Development Workflow - EclipseCon Europe 2014
Modern Web Application Development Workflow - EclipseCon Europe 2014
Stéphane Bégaudeau
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
AngularJS introduction
AngularJS introductionAngularJS introduction
AngularJS introduction
Tania Gonzales
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
Odoo Experience 2018 - Develop an App with the Odoo Framework
Odoo Experience 2018 - Develop an App with the Odoo FrameworkOdoo Experience 2018 - Develop an App with the Odoo Framework
Odoo Experience 2018 - Develop an App with the Odoo Framework
ElínAnna Jónasdóttir
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architecture
Michael He
 
An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications An Introduction To Testing In AngularJS Applications
An Introduction To Testing In AngularJS Applications
Rohan Chandane
 
Planbox Backbone MVC
Planbox Backbone MVCPlanbox Backbone MVC
Planbox Backbone MVC
Acquisio
 
SUGCon 2014 Sitecore MVC
SUGCon 2014 Sitecore MVCSUGCon 2014 Sitecore MVC
SUGCon 2014 Sitecore MVC
mikeedwards83
 
Advance java session 13
Advance java session 13Advance java session 13
Advance java session 13
Smita B Kumar
 
Backbone to React. What it says about awesome UI Code.
Backbone to React. What it says about awesome UI Code.Backbone to React. What it says about awesome UI Code.
Backbone to React. What it says about awesome UI Code.
Richard Powell
 
A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!A Good PHP Framework For Beginners Like Me!
A Good PHP Framework For Beginners Like Me!
Muhammad Ghazali
 
ASP.NET Routing & MVC
ASP.NET Routing & MVCASP.NET Routing & MVC
ASP.NET Routing & MVC
Emad Alashi
 

Viewers also liked (14)

Final project
Final projectFinal project
Final project
maiberlyn
 
Ideal Network - Cause Partners PowerPoint
Ideal Network - Cause Partners PowerPointIdeal Network - Cause Partners PowerPoint
Ideal Network - Cause Partners PowerPoint
IdealNetwork
 
6610 connorsmodule3final
6610 connorsmodule3final6610 connorsmodule3final
6610 connorsmodule3final
Melanie333
 
Optimize Today's Ideal With Facebook
Optimize Today's Ideal With FacebookOptimize Today's Ideal With Facebook
Optimize Today's Ideal With Facebook
IdealNetwork
 
pp4 axylegna gaga
pp4 axylegna gagapp4 axylegna gaga
pp4 axylegna gaga
axylegna
 
Final project
Final projectFinal project
Final project
maiberlyn
 
In defense of life - Masquechuchos
In defense of life - MasquechuchosIn defense of life - Masquechuchos
In defense of life - Masquechuchos
bcasares
 
Dragon's den
Dragon's denDragon's den
Dragon's den
jyook
 
Cloud Computing by Team Go Getters
Cloud Computing by Team Go GettersCloud Computing by Team Go Getters
Cloud Computing by Team Go Getters
Jay Shah
 
Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=Hibernate
Jay Shah
 
Mobile strategy and sophistication study for slideshare
Mobile strategy and sophistication study for slideshareMobile strategy and sophistication study for slideshare
Mobile strategy and sophistication study for slideshare
Stefan Tornquist
 
Μαθηματικά και άγχος
Μαθηματικά και άγχοςΜαθηματικά και άγχος
Μαθηματικά και άγχος
Φωτεινή Δασακλή
 
Richard Peers, Microsoft @ "How to Start a New Bank" Seminar
Richard Peers, Microsoft @ "How to Start a New Bank" SeminarRichard Peers, Microsoft @ "How to Start a New Bank" Seminar
Richard Peers, Microsoft @ "How to Start a New Bank" Seminar
Fiserv
 
Email Talk at AdTech '12
Email Talk at AdTech '12Email Talk at AdTech '12
Email Talk at AdTech '12
Stefan Tornquist
 
Final project
Final projectFinal project
Final project
maiberlyn
 
Ideal Network - Cause Partners PowerPoint
Ideal Network - Cause Partners PowerPointIdeal Network - Cause Partners PowerPoint
Ideal Network - Cause Partners PowerPoint
IdealNetwork
 
6610 connorsmodule3final
6610 connorsmodule3final6610 connorsmodule3final
6610 connorsmodule3final
Melanie333
 
Optimize Today's Ideal With Facebook
Optimize Today's Ideal With FacebookOptimize Today's Ideal With Facebook
Optimize Today's Ideal With Facebook
IdealNetwork
 
pp4 axylegna gaga
pp4 axylegna gagapp4 axylegna gaga
pp4 axylegna gaga
axylegna
 
Final project
Final projectFinal project
Final project
maiberlyn
 
In defense of life - Masquechuchos
In defense of life - MasquechuchosIn defense of life - Masquechuchos
In defense of life - Masquechuchos
bcasares
 
Dragon's den
Dragon's denDragon's den
Dragon's den
jyook
 
Cloud Computing by Team Go Getters
Cloud Computing by Team Go GettersCloud Computing by Team Go Getters
Cloud Computing by Team Go Getters
Jay Shah
 
Struts2-Spring=Hibernate
Struts2-Spring=HibernateStruts2-Spring=Hibernate
Struts2-Spring=Hibernate
Jay Shah
 
Mobile strategy and sophistication study for slideshare
Mobile strategy and sophistication study for slideshareMobile strategy and sophistication study for slideshare
Mobile strategy and sophistication study for slideshare
Stefan Tornquist
 
Richard Peers, Microsoft @ "How to Start a New Bank" Seminar
Richard Peers, Microsoft @ "How to Start a New Bank" SeminarRichard Peers, Microsoft @ "How to Start a New Bank" Seminar
Richard Peers, Microsoft @ "How to Start a New Bank" Seminar
Fiserv
 
Ad

Similar to Strut2-Spring-Hibernate (20)

struts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptxstruts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptx
ozakamal8
 
struts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptxstruts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptx
ozakamal8
 
Struts 1
Struts 1Struts 1
Struts 1
Lalit Garg
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
divzi1913
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
dasguptahirak
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
Matt Raible
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questions
jbashask
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
skill-guru
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
Long Nguyen
 
Wt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technologyWt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technology
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
Wt unit 2 ppts client side technology
Wt unit 2 ppts client side technologyWt unit 2 ppts client side technology
Wt unit 2 ppts client side technology
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
18CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-318CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-3
Sivakumar M
 
Struts
StrutsStruts
Struts
Rajkumar Singh
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
surendray
 
Ibm
IbmIbm
Ibm
techbed
 
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptxExtending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
Guilherme Pereira Silva
 
Struts 2 – Architecture
Struts 2 – ArchitectureStruts 2 – Architecture
Struts 2 – Architecture
Ducat India
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
elliando dias
 
struts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptxstruts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptx
ozakamal8
 
struts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptxstruts unit best pdf for struts java.pptx
struts unit best pdf for struts java.pptx
ozakamal8
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
divzi1913
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
Matt Raible
 
Struts Interview Questions
Struts Interview QuestionsStruts Interview Questions
Struts Interview Questions
jbashask
 
Struts 2 Overview
Struts 2 OverviewStruts 2 Overview
Struts 2 Overview
skill-guru
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
Long Nguyen
 
18CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-318CSC311J Web Design and Development UNIT-3
18CSC311J Web Design and Development UNIT-3
Sivakumar M
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
surendray
 
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptxExtending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
Guilherme Pereira Silva
 
Struts 2 – Architecture
Struts 2 – ArchitectureStruts 2 – Architecture
Struts 2 – Architecture
Ducat India
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
elliando dias
 
Ad

Recently uploaded (20)

Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 

Strut2-Spring-Hibernate

  • 3. Workshop Agenda Day 1 1.Understanding Struts2 2.Architecture of Struts2 3.Features of Struts2 4.Environment Setup 5.Understanding Configuration of Project
  • 4. Day 1 Continue 6.Practical Lab 7.Introduction to Hibernate 8.Demo of Struts2 Application
  • 5. Understanding Struts2 •Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. •The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time. •To make web development easier for the developers.
  • 8. What kind of MVC is Struts2 Struts 2 is pull MVC
  • 9. Request Life Cycle • User sends a request to the server for requesting for some resource (i.e pages). • The FilterDispatcher looks at the request and then determines the appropriate Action. • Configured interceptors functionalities applies such as validation, file upload etc.
  • 10. • Selected action is executed to perform the requested operation. • Again, configured interceptors are applied to do any post-processing if required. • Finally the result is prepared by the view and returns the result to the user.
  • 11. Features of Struts2 • POJO forms and POJO actions • Tag Support • AJAX Support • Easy Integration
  • 12. Features continued… • Template Support • Plugin Support • Profiling • Easy to modify tags • Promote less configuration • View Technologies (JSP, Velocity, Freemarker,etc)
  • 13. Environment Setup 4 Simple Steps: •Step 1 - Setup Java Development Kit (JDK) •Step 2 - Setup Apache Tomcat •Step 3 - Setup Eclipse (IDE) •Step 4 - Setup Struts2 Libraries
  • 14. Understand Configuring Project 4 Simple Steps •Create an Action Class •Create a View •Create a launch page •Now configure all of them
  • 15. Create an Action Class public class Student { private String fullName; public String execute() throws Exception { return "success"; } public String getFullName() { return name; } public void setFullName(String name) { this.name = name; } }
  • 16. Create View <%@ page contentType="text/html; charset=UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <title>Welcome to Team Go Getters</title> </head> <body> Hello, We are glad to have <s:property value=”fullName"/> as our student. </body> </html>
  • 17. Create a launch page <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Struts2 Workshop</title> </head> <body> <h1>Welcome to Team Go Getters</h1> <form action=”welcome"> <label for="name">Please enter your name</label><br/> <input type="text" name=”fullName"/> <input type="submit" value=”Enroll"/> </form> </body> </html>
  • 18. Configuration Files Struts.xml file •Mapping between URL ,Action classes and Result Types (View) •Since Struts 2 requires struts.xml to be present in classes folder. • So create struts.xml file under the WebContent/WEB- INF/classes folder.
  • 19. Struts.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> <package name=”workshop" extends="struts-default"> <action name=”welcome" class="com.teamgogetters.struts2.Employee" method="execute"> <result name="success">/Welcome.jsp</result> </action> </package> </struts>
  • 20. Multiple struts.xml files <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <include file="my-struts1.xml"/> <include file="my-struts2.xml"/> </struts>
  • 21. Web.xml • Entry point for any request to Struts 2 • Mapping FilterDispatcher • Deployment Descriptor • Security Parameters
  • 22. Web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>Struts 2</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
  • 23. Interceptors • Providing preprocessing logic before the action is called. • Providing post-processing logic after the action is called. • Catching exceptions so that alternate processing can be performed.
  • 24. List of Interceptors • timer • params • checkbox • createSession • logger • fileUpload • scope • alias
  • 25. Snippet <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> <package name=”workshop" extends="struts-default"> <action name=”welcome" class="com.teamgogetters.struts2.Employee" method="execute"> <interceptor-ref name="params"/> <interceptor-ref name="timer" /> <result name="success">/welcome.jsp</result> </action> </package> </struts>
  • 26. Result and Result Types • <results> tag plays the role of a view in the Struts2 MVC framework. The action is responsible for executing the business logic. The next step after executing the business logic is to display the view using the <results> tag. • Struts comes with a number of predefined result types and whatever we've already seen that was the default result type dispatcher, which is used to dispatch to JSP pages. Struts allow you to use other markup languages for the view technology to present the results and popular choices include Velocity, Freemaker, XSLT and Tiles.
  • 27. Snippet <result name="success" type="dispatcher"> <param name="location"> /HelloWorld.jsp </param > </result> <result name="success" type="freemarker"> <param name="location"> /hello.fm </param> </result> <result name="success" type="freemarker"> <param name="location"> /hello.fm </param> </result>
  • 29. JDBC is going obsolete? • Complex if it is used in large projects • Large programming overhead • No encapsulation • Hard to implement MVC concept • Query is DBMS specific
  • 31. Hibernate: ORM • Hibernate is a high-performance Object/Relational persistence and query service • Hibernate takes care of the mapping from Java classes to database tables • Hibernate data query and retrieval facilities
  • 32. ORM New Generation 1. Let business code access objects rather than DB tables. 2. Hides details of SQL queries from OO logic. 3. Based on JDBC 'under the hood’ 4. No need to deal with the database implementation.
  • 33. ORM New Generation… 5. Entities based on business concepts rather than database structure. 6. Transaction management and automatic key generation. 7. Fast development of application.
  • 35. Hold your breathe till tomorrow
  • 36. Demo