SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Chaper 2 Servlets / JSP Course Introduction to JavaServer Pages
Servlet / JSP course topics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introduction to JavaServer Pages
Intorduction to JavaServer Pages ,[object Object],[object Object],[object Object],[object Object]
What Is a JSP Page? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What Is a JSP Page? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The Life Cycle of a JSP Page ,[object Object],[object Object],[object Object],[object Object],[object Object]
The Life Cycle of a JSP Page
The Life Cycle of  executing a JSP Page
Exercise 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exercise 1 Results ,[object Object]
Exercise 1 Results
Exercise 1 Results ,[object Object],< form   action = &quot; display_email_entry.jsp &quot;   method = &quot;post&quot; > < table   cellspacing = &quot;5&quot;   border = &quot;0&quot; > < tr > < td   align = &quot;right&quot; > First name: </ td > < td >< input   type = &quot;text&quot;   name = &quot;firstName&quot; ></ td > </ tr > < tr > < td   align = &quot;right&quot; > Last name: </ td > < td >< input   type = &quot;text&quot;   name = &quot;lastName&quot; ></ td > </ tr > < tr > < td   align = &quot;right&quot; > Email address: </ td > < td >< input   type = &quot;text&quot;   name = &quot;emailAddress&quot; ></ td > </ tr > < tr > < td ></ td > < td >< br >< input   type = &quot;submit&quot;   value = &quot;Submit&quot; ></ td > </ tr > </ table > </ form > The action is mapped to a JSP
Exercise 1 Results ,[object Object],. . .  <!-- import packages and classes needed by the scripts --> <%@   page   import = &quot;business.*, data.*, java.util.Date&quot;   %> <% // get parameters from the request String firstName =  request .getParameter( &quot;firstName&quot; ); String lastName =  request .getParameter( &quot;lastName&quot; ); String emailAddress =  request .getParameter( &quot;emailAddress&quot; ); // get a relative file name ServletContext sc =  this .getServletContext(); String path = sc.getRealPath( &quot;/WEB-INF/EmailList.txt&quot; ); // use regular Java objects User user =  new  User(firstName, lastName, emailAddress); UserIO.add(user, path); %> . . . The request object Accesed by variables
Exercise 1 Results ,[object Object],. . .  < p > Here is the information that you entered: </ p > < table   cellspacing = &quot;5&quot;   cellpadding = &quot;5&quot;   border = &quot;1&quot; > < tr > < td   align = &quot;right&quot; > First name: </ td > < td > <%=  user.getFirstName()  %> </ td > </ tr > < tr > < td   align = &quot;right&quot; > Last name: </ td > < td > <%=  user.getLastName()  %> </ td > </ tr > < tr > < td   align = &quot;right&quot; > Email address: </ td > < td > <%=  user.getEmailAddress()  %> </ td > </ tr > </ table > . . . The response object Is implicit
Exercise 1 Results ,[object Object]
Exercise 1 Results ,[object Object],. . .  // send response to browser response.setContentType( &quot;text/html;charset=UTF-8&quot; ); PrintWriter out = response.getWriter();  out.println( . . . +  &quot;  <table cellspacing=amp;quot;5amp;quot; cellpadding=amp;quot;5amp;quot; border=amp;quot;1amp;quot;>&quot; +  &quot;  <tr><td align=amp;quot;rightamp;quot;>First name:</td>&quot; +  &quot;  <td>&quot;  + firstName +  &quot;</td>&quot; +  &quot;  </tr>&quot; +  &quot;  <tr><td align=amp;quot;rightamp;quot;>Last name:</td>&quot; +  &quot;  <td>&quot;  + lastName +  &quot;</td>&quot; +  &quot;  </tr>&quot; +  &quot;  <tr><td align=amp;quot;rightamp;quot;>Email address:</td>&quot; +  &quot;  <td>&quot;  + emailAddress +  &quot;</td>&quot; +  &quot;  </tr>&quot; +  &quot;  </table>&quot; . . . out.close(); . . .
JSP syntax
JSP syntax
Resources To download example code for this chapter go to: http://www.jeetrainers.com

Weitere Àhnliche Inhalte

Was ist angesagt?

JSP Processing
JSP ProcessingJSP Processing
JSP Processing
Sadhana28
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
vikram singh
 
JAVA SERVER PAGES
JAVA SERVER PAGESJAVA SERVER PAGES
JAVA SERVER PAGES
Kalpana T
 
Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generation
Eleonora Ciceri
 
Jsp Slides
Jsp SlidesJsp Slides
Jsp Slides
DSKUMAR G
 
Jsp slides
Jsp slidesJsp slides
Jsp slides
Kumaran K
 

Was ist angesagt? (20)

Jsp
JspJsp
Jsp
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
 
JSP Processing
JSP ProcessingJSP Processing
JSP Processing
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
 
Jsp element
Jsp elementJsp element
Jsp element
 
Jsp
JspJsp
Jsp
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
JAVA SERVER PAGES
JAVA SERVER PAGESJAVA SERVER PAGES
JAVA SERVER PAGES
 
Jsp tutorial (1)
Jsp tutorial (1)Jsp tutorial (1)
Jsp tutorial (1)
 
Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generation
 
Jsp elements
Jsp elementsJsp elements
Jsp elements
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance Java
 
Jsp Slides
Jsp SlidesJsp Slides
Jsp Slides
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Jsp slides
Jsp slidesJsp slides
Jsp slides
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technology
 
Jsp sasidhar
Jsp sasidharJsp sasidhar
Jsp sasidhar
 
1 java servlets and jsp
1   java servlets and jsp1   java servlets and jsp
1 java servlets and jsp
 
Jsp Introduction Tutorial
Jsp Introduction TutorialJsp Introduction Tutorial
Jsp Introduction Tutorial
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
 

Andere mochten auch

Web engineering 2(lect 0)
Web engineering 2(lect 0)Web engineering 2(lect 0)
Web engineering 2(lect 0)
Roohul Amin
 
Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2
billdigman
 

Andere mochten auch (11)

Servidores web
Servidores webServidores web
Servidores web
 
Web engineering 2(lect 2)
Web engineering 2(lect 2)Web engineering 2(lect 2)
Web engineering 2(lect 2)
 
Jsp 2 Research Methods
Jsp 2 Research MethodsJsp 2 Research Methods
Jsp 2 Research Methods
 
Web engineering 2(lect 0)
Web engineering 2(lect 0)Web engineering 2(lect 0)
Web engineering 2(lect 0)
 
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....
OOWS 2.0: A Model-driven Web Engineering Method for the Development of Web 2....
 
Web engineering (2)
Web engineering (2)Web engineering (2)
Web engineering (2)
 
Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2Java EE Servlet/JSP Tutorial- Cookbook 2
Java EE Servlet/JSP Tutorial- Cookbook 2
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOM
 
Web Engineering
Web EngineeringWeb Engineering
Web Engineering
 
Startup Secrets - Building a Compelling Value Proposition
Startup Secrets - Building a Compelling Value PropositionStartup Secrets - Building a Compelling Value Proposition
Startup Secrets - Building a Compelling Value Proposition
 
6 SWOT Analysis Examples to Help You Write Your Own
6 SWOT Analysis Examples to Help You Write Your Own6 SWOT Analysis Examples to Help You Write Your Own
6 SWOT Analysis Examples to Help You Write Your Own
 

Ähnlich wie Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)

29 Jsp
29 Jsp29 Jsp
29 Jsp
DSKUMAR G
 
Facelets
FaceletsFacelets
Facelets
lingli1031
 

Ähnlich wie Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP) (20)

Jsp 01
Jsp 01Jsp 01
Jsp 01
 
Servlet/JSP course chapter 1: Introduction to servlets
Servlet/JSP course chapter 1: Introduction to servletsServlet/JSP course chapter 1: Introduction to servlets
Servlet/JSP course chapter 1: Introduction to servlets
 
29 Jsp
29 Jsp29 Jsp
29 Jsp
 
Jsp
JspJsp
Jsp
 
JSP.pptx
JSP.pptxJSP.pptx
JSP.pptx
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGES
 
Learning jsp
Learning jspLearning jsp
Learning jsp
 
Struts2
Struts2Struts2
Struts2
 
Jsp
JspJsp
Jsp
 
Jsp Presentation +Mufix "3"
Jsp Presentation +Mufix "3"Jsp Presentation +Mufix "3"
Jsp Presentation +Mufix "3"
 
JSP
JSPJSP
JSP
 
KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 5/7KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 5/7
 
KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 5/7KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 5/7
 
I Feel Pretty
I Feel PrettyI Feel Pretty
I Feel Pretty
 
Boston Computing Review - Java Server Pages
Boston Computing Review - Java Server PagesBoston Computing Review - Java Server Pages
Boston Computing Review - Java Server Pages
 
Unit 4 web technology uptu
Unit 4 web technology uptuUnit 4 web technology uptu
Unit 4 web technology uptu
 
Unit 4 1 web technology uptu
Unit 4 1 web technology uptuUnit 4 1 web technology uptu
Unit 4 1 web technology uptu
 
Jsp
JspJsp
Jsp
 
Facelets
FaceletsFacelets
Facelets
 
Jsp
JspJsp
Jsp
 

Mehr von JavaEE Trainers (8)

Introduction tomcat7 servlet3
Introduction tomcat7 servlet3Introduction tomcat7 servlet3
Introduction tomcat7 servlet3
 
Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009Introduction to java servlet 3.0 api javaone 2009
Introduction to java servlet 3.0 api javaone 2009
 
Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008Introduction to java servlet 3.0 api javaone 2008
Introduction to java servlet 3.0 api javaone 2008
 
Jsp quick reference card
Jsp quick reference cardJsp quick reference card
Jsp quick reference card
 
jsp, javaserver pages, Card20
jsp, javaserver pages, Card20jsp, javaserver pages, Card20
jsp, javaserver pages, Card20
 
Struts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configurationStruts2 course chapter 2: installation and configuration
Struts2 course chapter 2: installation and configuration
 
Struts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web ApplicationsStruts2 course chapter 1: Evolution of Web Applications
Struts2 course chapter 1: Evolution of Web Applications
 
Struts2 Course: Introduction
Struts2 Course: IntroductionStruts2 Course: Introduction
Struts2 Course: Introduction
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

KĂŒrzlich hochgeladen (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)

Hinweis der Redaktion

  1. &lt;iframe src=&amp;quot;http://rcm.amazon.com/e/cm?t=marcelblog-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=1932394389&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr&amp;quot; style=&amp;quot;width:120px;height:240px;&amp;quot; scrolling=&amp;quot;no&amp;quot; marginwidth=&amp;quot;0&amp;quot; marginheight=&amp;quot;0&amp;quot; frameborder=&amp;quot;0&amp;quot;&gt;&lt;/iframe&gt;