SlideShare a Scribd company logo
Working with Java Server Pages
Agenda
• Understand the need for Java Server pages
• Evaluating the benefits of Java Server pages(JSP)
• Understanding JSP Lifecycle
• Installing JSP pages
Need for JSP
• JSP is a template page technology
- High level abstraction of Servlets
• Separation of presentation from logic
• Even non java programmer can create JSP pages with reasonable ease
JSP Introduction
• Idea:
- Use regular HTML for most of page
- Mark servlet code with special tags
- Entire JSP page gets translated into a servlet (once), and
- servlet is what actually gets invoked (for each request)
• Example:
<!DOCTYPE …><HTML><HEAD><TITLE>Order Confirmation</TITLE>
<LINK REL=STYLESHEET HREF="JSP-Styles.css” TYPE="text/css">
</HEAD><BODY><H2>Order Confirmation</H2>
Thanks for ordering
<I><%= request.getParameter("title") %></I>!
</BODY></HTML>
JSP lifeCycle
• Translation
- JSP page is translated into a Servlet by JSP container
• Compilation
- The generated file is compiled into a servlet.
• Class Loading
- The generated Servlet is then loaded in the container
• Execution
- The loaded JSP is executing by the container in response to request and
calling the lifecycle methods
JSP lifeCycle(cont)
• Initialization
- JspInit() method is called immediately after the instance was created.
• _jspService() execution
- This method is called for every request of the JSP during lifecycle
- This method cannot be overridden by the page author
• jspDestroy()
- This method is called when the jsp is destroyed.
• jspInit(),_jspService(), jspDestroy() are the lifecycle methods of JSP
Benefits of JSP
• Simple to use
• Requires little of no knowledge of java
• Platform independent (built of java)
• Easy to learn and migrate being similar to PHP and ASP
• Well Documented
Installing JSP
• JSP is part of JEE specification
• It’s library is available in all the JEE compliant Server
• We need to create JSP File in the context-root
• No need to
- set classpath
- Compile
- Configure xml
Summary
• JSP makes it easier to create and maintain HTML, while still
providing full access to servlet code
• JSP pages get translated into servlets
- It is the servlets that run at request time
- Client does not see anything JSP-related
• You still need to understand servlets
- Understanding how JSP really works
- Servlet code called from JSP
- Knowing when servlets are better than JSP
- Mixing servlets and JSP
• Other technologies use similar approach, but aren't as portable and
don't let you use Java for the "real code

More Related Content

What's hot

Eenterprises Java
Eenterprises  JavaEenterprises  Java
Eenterprises Java
PandeyABHISHEK1
 
Ch. 13 filters and wrappers
Ch. 13 filters and wrappersCh. 13 filters and wrappers
Ch. 13 filters and wrappersManolis Vavalis
 
Ch5 beeing an application
Ch5   beeing an applicationCh5   beeing an application
Ch5 beeing an application
Manolis Vavalis
 
Shootout! Template engines for the JVM
Shootout! Template engines for the JVMShootout! Template engines for the JVM
Shootout! Template engines for the JVM
Jeroen Reijn
 
Jsp basic
Jsp basicJsp basic
Jsp basic
Jaya Kumari
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQ
Rest West
 
MVVM Windows UWP apps with Template 10
MVVM Windows UWP apps with Template 10MVVM Windows UWP apps with Template 10
MVVM Windows UWP apps with Template 10
Jiri Danihelka
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sitesdrupalcampest
 
MySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of viewMySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of view
Sachin Khosla
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
GreeceJS
 
Zend framework 02 - mvc
Zend framework 02 - mvcZend framework 02 - mvc
Zend framework 02 - mvc
Tricode (part of Dept)
 
Jsp
JspJsp
Multi-tenant Database Design for SaaS
Multi-tenant Database Design for SaaSMulti-tenant Database Design for SaaS
Multi-tenant Database Design for SaaS
Võ Duy Tuấn
 
Web Development Today
Web Development TodayWeb Development Today
Web Development Today
bretticus
 
Beanshell scripting in Apache JMeter
Beanshell scripting in Apache JMeterBeanshell scripting in Apache JMeter
Beanshell scripting in Apache JMeter
NaveenKumar Namachivayam
 
Reactjs workshop
Reactjs workshopReactjs workshop
Reactjs workshop
Pankaj Bhageria
 
Javascript
JavascriptJavascript
Javascript
Ekansh Purwar
 

What's hot (19)

Eenterprises Java
Eenterprises  JavaEenterprises  Java
Eenterprises Java
 
Ch. 11 deploying
Ch. 11 deployingCh. 11 deploying
Ch. 11 deploying
 
Ch. 13 filters and wrappers
Ch. 13 filters and wrappersCh. 13 filters and wrappers
Ch. 13 filters and wrappers
 
Ch5 beeing an application
Ch5   beeing an applicationCh5   beeing an application
Ch5 beeing an application
 
Shootout! Template engines for the JVM
Shootout! Template engines for the JVMShootout! Template engines for the JVM
Shootout! Template engines for the JVM
 
Jsp basic
Jsp basicJsp basic
Jsp basic
 
Introdcution to Adobe CQ
Introdcution to Adobe CQIntrodcution to Adobe CQ
Introdcution to Adobe CQ
 
MVVM Windows UWP apps with Template 10
MVVM Windows UWP apps with Template 10MVVM Windows UWP apps with Template 10
MVVM Windows UWP apps with Template 10
 
Drupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance SitesDrupalcamp Estonia - High Performance Sites
Drupalcamp Estonia - High Performance Sites
 
MySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of viewMySQL Optimization from a Developer's point of view
MySQL Optimization from a Developer's point of view
 
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
 
Metarefresh
MetarefreshMetarefresh
Metarefresh
 
Zend framework 02 - mvc
Zend framework 02 - mvcZend framework 02 - mvc
Zend framework 02 - mvc
 
Jsp
JspJsp
Jsp
 
Multi-tenant Database Design for SaaS
Multi-tenant Database Design for SaaSMulti-tenant Database Design for SaaS
Multi-tenant Database Design for SaaS
 
Web Development Today
Web Development TodayWeb Development Today
Web Development Today
 
Beanshell scripting in Apache JMeter
Beanshell scripting in Apache JMeterBeanshell scripting in Apache JMeter
Beanshell scripting in Apache JMeter
 
Reactjs workshop
Reactjs workshopReactjs workshop
Reactjs workshop
 
Javascript
JavascriptJavascript
Javascript
 

Similar to Advance java session 9

Core web application development
Core web application developmentCore web application development
Core web application developmentBahaa Farouk
 
JSP Part 1
JSP Part 1JSP Part 1
JSP Part 1
DeeptiJava
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
arya krazydude
 
Jsp
JspJsp
Jsp
JspJsp
JavaScript, often abbreviated as JS, is a programming language and core techn...
JavaScript, often abbreviated as JS, is a programming language and core techn...JavaScript, often abbreviated as JS, is a programming language and core techn...
JavaScript, often abbreviated as JS, is a programming language and core techn...
MathivananP4
 
Jsp
JspJsp
Enterprise java unit-3_chapter-1-jsp
Enterprise  java unit-3_chapter-1-jspEnterprise  java unit-3_chapter-1-jsp
Enterprise java unit-3_chapter-1-jsp
sandeep54552
 
Wt unit 4
Wt unit 4Wt unit 4
Wt unit 4
team11vgnt
 
005432796.pdf
005432796.pdf005432796.pdf
005432796.pdf
EidTahir
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
Shah Nawaz Bhurt
 
Jsp abes new
Jsp abes newJsp abes new
Jsp abes new
Ashwin Perti
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Jsp
JspJsp
Java
JavaJava
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
Raheela Patel
 
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
sivakumarmcs
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 

Similar to Advance java session 9 (20)

Core web application development
Core web application developmentCore web application development
Core web application development
 
JSP Part 1
JSP Part 1JSP Part 1
JSP Part 1
 
20jsp
20jsp20jsp
20jsp
 
Project First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be usedProject First presentation about introduction to technologies to be used
Project First presentation about introduction to technologies to be used
 
Coursejspservlets00
Coursejspservlets00Coursejspservlets00
Coursejspservlets00
 
Jsp
JspJsp
Jsp
 
Jsp
JspJsp
Jsp
 
JavaScript, often abbreviated as JS, is a programming language and core techn...
JavaScript, often abbreviated as JS, is a programming language and core techn...JavaScript, often abbreviated as JS, is a programming language and core techn...
JavaScript, often abbreviated as JS, is a programming language and core techn...
 
Jsp
JspJsp
Jsp
 
Enterprise java unit-3_chapter-1-jsp
Enterprise  java unit-3_chapter-1-jspEnterprise  java unit-3_chapter-1-jsp
Enterprise java unit-3_chapter-1-jsp
 
Wt unit 4
Wt unit 4Wt unit 4
Wt unit 4
 
005432796.pdf
005432796.pdf005432796.pdf
005432796.pdf
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Jsp abes new
Jsp abes newJsp abes new
Jsp abes new
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
 
Jsp
JspJsp
Jsp
 
Java
JavaJava
Java
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
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
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
 

More from Smita B Kumar

Advance java session 20
Advance java session 20Advance java session 20
Advance java session 20
Smita B Kumar
 
Advance java session 19
Advance java session 19Advance java session 19
Advance java session 19
Smita B Kumar
 
Advance java session 18
Advance java session 18Advance java session 18
Advance java session 18
Smita B Kumar
 
Advance java session 17
Advance java session 17Advance java session 17
Advance java session 17
Smita B Kumar
 
Advance java session 16
Advance java session 16Advance java session 16
Advance java session 16
Smita B Kumar
 
Advance java session 15
Advance java session 15Advance java session 15
Advance java session 15
Smita B Kumar
 
Advance java session 14
Advance java session 14Advance java session 14
Advance java session 14
Smita B Kumar
 
Advance java session 13
Advance java session 13Advance java session 13
Advance java session 13
Smita B Kumar
 
Advance java session 12
Advance java session 12Advance java session 12
Advance java session 12
Smita B Kumar
 
Advance java session 11
Advance java session 11Advance java session 11
Advance java session 11
Smita B Kumar
 
Advance java session 10
Advance java session 10Advance java session 10
Advance java session 10
Smita B Kumar
 
Advance java session 8
Advance java session 8Advance java session 8
Advance java session 8
Smita B Kumar
 
Advance java session 7
Advance java session 7Advance java session 7
Advance java session 7
Smita B Kumar
 
Advance java session 6
Advance java session 6Advance java session 6
Advance java session 6
Smita B Kumar
 
Advance java session 5
Advance java session 5Advance java session 5
Advance java session 5
Smita B Kumar
 
Advance java session 4
Advance java session 4Advance java session 4
Advance java session 4
Smita B Kumar
 
Advance java session 3
Advance java session 3Advance java session 3
Advance java session 3
Smita B Kumar
 
Advance java session 2
Advance java session 2Advance java session 2
Advance java session 2
Smita B Kumar
 
JEE session 1
JEE session 1JEE session 1
JEE session 1
Smita B Kumar
 
01 introduction to struts2
01 introduction to struts201 introduction to struts2
01 introduction to struts2
Smita B Kumar
 

More from Smita B Kumar (20)

Advance java session 20
Advance java session 20Advance java session 20
Advance java session 20
 
Advance java session 19
Advance java session 19Advance java session 19
Advance java session 19
 
Advance java session 18
Advance java session 18Advance java session 18
Advance java session 18
 
Advance java session 17
Advance java session 17Advance java session 17
Advance java session 17
 
Advance java session 16
Advance java session 16Advance java session 16
Advance java session 16
 
Advance java session 15
Advance java session 15Advance java session 15
Advance java session 15
 
Advance java session 14
Advance java session 14Advance java session 14
Advance java session 14
 
Advance java session 13
Advance java session 13Advance java session 13
Advance java session 13
 
Advance java session 12
Advance java session 12Advance java session 12
Advance java session 12
 
Advance java session 11
Advance java session 11Advance java session 11
Advance java session 11
 
Advance java session 10
Advance java session 10Advance java session 10
Advance java session 10
 
Advance java session 8
Advance java session 8Advance java session 8
Advance java session 8
 
Advance java session 7
Advance java session 7Advance java session 7
Advance java session 7
 
Advance java session 6
Advance java session 6Advance java session 6
Advance java session 6
 
Advance java session 5
Advance java session 5Advance java session 5
Advance java session 5
 
Advance java session 4
Advance java session 4Advance java session 4
Advance java session 4
 
Advance java session 3
Advance java session 3Advance java session 3
Advance java session 3
 
Advance java session 2
Advance java session 2Advance java session 2
Advance java session 2
 
JEE session 1
JEE session 1JEE session 1
JEE session 1
 
01 introduction to struts2
01 introduction to struts201 introduction to struts2
01 introduction to struts2
 

Recently uploaded

Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 

Recently uploaded (20)

Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 

Advance java session 9

  • 1. Working with Java Server Pages
  • 2. Agenda • Understand the need for Java Server pages • Evaluating the benefits of Java Server pages(JSP) • Understanding JSP Lifecycle • Installing JSP pages
  • 3. Need for JSP • JSP is a template page technology - High level abstraction of Servlets • Separation of presentation from logic • Even non java programmer can create JSP pages with reasonable ease
  • 4. JSP Introduction • Idea: - Use regular HTML for most of page - Mark servlet code with special tags - Entire JSP page gets translated into a servlet (once), and - servlet is what actually gets invoked (for each request) • Example: <!DOCTYPE …><HTML><HEAD><TITLE>Order Confirmation</TITLE> <LINK REL=STYLESHEET HREF="JSP-Styles.css” TYPE="text/css"> </HEAD><BODY><H2>Order Confirmation</H2> Thanks for ordering <I><%= request.getParameter("title") %></I>! </BODY></HTML>
  • 5. JSP lifeCycle • Translation - JSP page is translated into a Servlet by JSP container • Compilation - The generated file is compiled into a servlet. • Class Loading - The generated Servlet is then loaded in the container • Execution - The loaded JSP is executing by the container in response to request and calling the lifecycle methods
  • 6. JSP lifeCycle(cont) • Initialization - JspInit() method is called immediately after the instance was created. • _jspService() execution - This method is called for every request of the JSP during lifecycle - This method cannot be overridden by the page author • jspDestroy() - This method is called when the jsp is destroyed. • jspInit(),_jspService(), jspDestroy() are the lifecycle methods of JSP
  • 7. Benefits of JSP • Simple to use • Requires little of no knowledge of java • Platform independent (built of java) • Easy to learn and migrate being similar to PHP and ASP • Well Documented
  • 8. Installing JSP • JSP is part of JEE specification • It’s library is available in all the JEE compliant Server • We need to create JSP File in the context-root • No need to - set classpath - Compile - Configure xml
  • 9. Summary • JSP makes it easier to create and maintain HTML, while still providing full access to servlet code • JSP pages get translated into servlets - It is the servlets that run at request time - Client does not see anything JSP-related • You still need to understand servlets - Understanding how JSP really works - Servlet code called from JSP - Knowing when servlets are better than JSP - Mixing servlets and JSP • Other technologies use similar approach, but aren't as portable and don't let you use Java for the "real code