SlideShare uma empresa Scribd logo
1 de 15
JAVA SERVER PAGES


Dynamic
 Web
Content
 With
  Ease




                     1
Let’s Learn JSP


Now What The Heck Is


 JSP
                       2
Introduction

• JavaServer Pages (JSP) is
  a Java technology that helps software
  developers    serve dynamically generated
  web pages based on HTML,XML, or other
  document types.

• Released in 1999 as Sun's answer
  to ASP and PHP .

                                         3
Comparison
Function/Feature   JSP                       PHP
Programming        Completely Object         Scripting language
Approach           Oriented but way too      with Object Oriented
                   descriptive.              Support.
String and data    Rich library              Rich Functionality .
manipulation                                 Inbuilt support to
                                             include third party
                                             libraries from other
                                             languages.
Learning curve     It helps if you have an   If you know C/C++,
                   decent understanding      then you are halfway
                   of JAVA and its           through to learn PHP.
                   architecture.
Web Oriented       Inbuilt Functionality     Inbuilt Functionality
Features           but way too much of       but less lines of code
                   code.                     and less time to build
                                             an application.          4
Advantages of JSP

• Versus Active Server Pages (ASP)
 JSP is portable to other operating systems
and Web servers; you aren’t locked into
Windows.

• Versus Servlets
 It is more convenient to write (and to
modify!) regular HTML than to have a zillion
println statements that generate the HTML.
                                          5
Let’s Dive into the World of JSP

   • What are JAVA servlets ?
   Servlets are java programs that run on a web
   server and are user to make webpages on a
   fly (dynamic).
   • Advantages of Servlets :
   Powerful ,portable and Cheaper than many
   other alternatives .



                                              6
•So aren’t JSP
 and Servlets
 the Same ..
•
                 7
The Difference

• Servlets, make you generate the entire
  page via your program, even though most
  of it is always the same. JSP lets you
  create the two parts separately.

• So everything a servlet can do JSP can
  and further it is more easier to write .

• Developers & Designers at there best .
                                             8
Let’s a build a basic app

 • Setup and Installation
 Step 1. Download and install a Java Developer
 Kit.
  Step 2. Download and install the Apache-
 Tomcat web server.
 Step 3. Open Your browser and type
 http://localhost:8080 .
 Step 4: Save your app inside the root folder in
 apache .
 Step 5: Type
 http://localhost:8080/<appname.jsp> to run you  9
Time For Some Coding

 <%@page contentType="text/html" import="java.util.*" %>   1st JSP tag
<html>
<body>
<p>&nbsp;</p>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="460"
bgcolor="#EEFFCA">
<tr>
<td width="100%"><font size="6" color="#008000">&nbsp;Date
Example</font></td>
</tr>
<tr>
<td width="100%"><b>&nbsp;Current Date and time is:&nbsp; <font
color="#FF0000">
<%= new java.util.Date() %>               2nd JSP tag
</font></b></td>
</tr>
</table>
</center>
</div>
</body>
</html>
                                                                         10
Another Example


Create a simple HTML page having the following
output :


Select Your Sport :
 Cricket
Basketball
 Soccer
Rugby
Hockey
                                                 11
JSP Coding Part

•   <html>
    <body>
    <%! String[] sports; %>
    <center>You have selected:
    <%
      sports = request.getParameterValues("sports");
      if (sports != null)
      {
         for (int i = 0; i < sports.length; i++)
         {
           out.println ("<b>"+sports[i]+"<b>");
         }
      }
      else out.println ("<b>none<b>");
    %>
    </center>
    </body>
    </html>                                            12
The Output


You have selected: Cricket
Soccer




                             13
That Was Easy ..

• So with the help of some simple examples
  we saw the Power of JSP.

One can make JSP work the way he/she
wants and develop a full fledged web app
with it ..


        So , CODE & DESIGN ..
The world is all yours..
                                           14
Thank You 



Presented By :-



      Apoorv Anand
                  @APo_ORV
                         15

Mais conteúdo relacionado

Mais procurados

Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practicesejjavies
 
Ch. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryCh. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryManolis Vavalis
 
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010Arun Gupta
 
15 expression-language
15 expression-language15 expression-language
15 expression-languagesnopteck
 
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου ΙστούManolis Vavalis
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...WebStackAcademy
 
11 page-directive
11 page-directive11 page-directive
11 page-directivesnopteck
 

Mais procurados (20)

19servlets
19servlets19servlets
19servlets
 
Jsp
JspJsp
Jsp
 
WEB TECHNOLOGIES JSP
WEB TECHNOLOGIES  JSPWEB TECHNOLOGIES  JSP
WEB TECHNOLOGIES JSP
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
 
Ch. 8 script free pages
Ch. 8 script free pagesCh. 8 script free pages
Ch. 8 script free pages
 
Being a jsp
Being a jsp     Being a jsp
Being a jsp
 
Ch. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryCh. 9 jsp standard tag library
Ch. 9 jsp standard tag library
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
 
Ch. 7 beeing a jsp
Ch. 7 beeing a jsp     Ch. 7 beeing a jsp
Ch. 7 beeing a jsp
 
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
 
Jsp tutorial
Jsp tutorialJsp tutorial
Jsp tutorial
 
15 expression-language
15 expression-language15 expression-language
15 expression-language
 
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
 
Client side scripting and server side scripting
Client side scripting and server side scriptingClient side scripting and server side scripting
Client side scripting and server side scripting
 
C:\fakepath\jsp01
C:\fakepath\jsp01C:\fakepath\jsp01
C:\fakepath\jsp01
 
Wt unit 4
Wt unit 4Wt unit 4
Wt unit 4
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 7 ...
 
11 page-directive
11 page-directive11 page-directive
11 page-directive
 
Aem best practices
Aem best practicesAem best practices
Aem best practices
 
Wt unit 3
Wt unit 3 Wt unit 3
Wt unit 3
 

Semelhante a Java server pages

JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE abile technologies
 
Agile Software Development by Sencha
Agile Software Development by SenchaAgile Software Development by Sencha
Agile Software Development by SenchaLael Rukius
 
SoftwareUniversity seminar fast REST Api with Spring
SoftwareUniversity seminar fast REST Api with SpringSoftwareUniversity seminar fast REST Api with Spring
SoftwareUniversity seminar fast REST Api with SpringNayden Gochev
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...MCM COmpetitive Classes
 
Overview of Java
Overview of JavaOverview of Java
Overview of Javajosemachoco
 
Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac xRemote Stacx
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentationdhananajay95
 
Raisa anthony web programming 1st week
Raisa anthony   web programming 1st weekRaisa anthony   web programming 1st week
Raisa anthony web programming 1st weekRaisa Anjani
 
Follow these reasons to know java’s importance
Follow these reasons to know java’s importanceFollow these reasons to know java’s importance
Follow these reasons to know java’s importancenishajj
 
presentation on online movie ticket booking
presentation on online movie ticket bookingpresentation on online movie ticket booking
presentation on online movie ticket bookingdharmawath
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationJonathan Abrams
 

Semelhante a Java server pages (20)

Jsp abes new
Jsp abes newJsp abes new
Jsp abes new
 
Analysis
AnalysisAnalysis
Analysis
 
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
 
Agile Software Development by Sencha
Agile Software Development by SenchaAgile Software Development by Sencha
Agile Software Development by Sencha
 
JavaScript Toolkit
JavaScript ToolkitJavaScript Toolkit
JavaScript Toolkit
 
Jsp Comparison
 Jsp Comparison Jsp Comparison
Jsp Comparison
 
SoftwareUniversity seminar fast REST Api with Spring
SoftwareUniversity seminar fast REST Api with SpringSoftwareUniversity seminar fast REST Api with Spring
SoftwareUniversity seminar fast REST Api with Spring
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...
 
Java
JavaJava
Java
 
Jsp(java server pages)
Jsp(java server pages)Jsp(java server pages)
Jsp(java server pages)
 
Jsp
JspJsp
Jsp
 
Devjyotippt
DevjyotipptDevjyotippt
Devjyotippt
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
 
Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac x
 
Spatial approximate string search Doc
Spatial approximate string search DocSpatial approximate string search Doc
Spatial approximate string search Doc
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
 
Raisa anthony web programming 1st week
Raisa anthony   web programming 1st weekRaisa anthony   web programming 1st week
Raisa anthony web programming 1st week
 
Follow these reasons to know java’s importance
Follow these reasons to know java’s importanceFollow these reasons to know java’s importance
Follow these reasons to know java’s importance
 
presentation on online movie ticket booking
presentation on online movie ticket bookingpresentation on online movie ticket booking
presentation on online movie ticket booking
 
December 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig PresentationDecember 4 SDForum Java Sig Presentation
December 4 SDForum Java Sig Presentation
 

Último

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 

Último (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Java server pages

  • 1. JAVA SERVER PAGES Dynamic Web Content With Ease 1
  • 2. Let’s Learn JSP Now What The Heck Is JSP 2
  • 3. Introduction • JavaServer Pages (JSP) is a Java technology that helps software developers serve dynamically generated web pages based on HTML,XML, or other document types. • Released in 1999 as Sun's answer to ASP and PHP . 3
  • 4. Comparison Function/Feature JSP PHP Programming Completely Object Scripting language Approach Oriented but way too with Object Oriented descriptive. Support. String and data Rich library Rich Functionality . manipulation Inbuilt support to include third party libraries from other languages. Learning curve It helps if you have an If you know C/C++, decent understanding then you are halfway of JAVA and its through to learn PHP. architecture. Web Oriented Inbuilt Functionality Inbuilt Functionality Features but way too much of but less lines of code code. and less time to build an application. 4
  • 5. Advantages of JSP • Versus Active Server Pages (ASP) JSP is portable to other operating systems and Web servers; you aren’t locked into Windows. • Versus Servlets It is more convenient to write (and to modify!) regular HTML than to have a zillion println statements that generate the HTML. 5
  • 6. Let’s Dive into the World of JSP • What are JAVA servlets ? Servlets are java programs that run on a web server and are user to make webpages on a fly (dynamic). • Advantages of Servlets : Powerful ,portable and Cheaper than many other alternatives . 6
  • 7. •So aren’t JSP and Servlets the Same .. • 7
  • 8. The Difference • Servlets, make you generate the entire page via your program, even though most of it is always the same. JSP lets you create the two parts separately. • So everything a servlet can do JSP can and further it is more easier to write . • Developers & Designers at there best . 8
  • 9. Let’s a build a basic app • Setup and Installation Step 1. Download and install a Java Developer Kit. Step 2. Download and install the Apache- Tomcat web server. Step 3. Open Your browser and type http://localhost:8080 . Step 4: Save your app inside the root folder in apache . Step 5: Type http://localhost:8080/<appname.jsp> to run you 9
  • 10. Time For Some Coding <%@page contentType="text/html" import="java.util.*" %> 1st JSP tag <html> <body> <p>&nbsp;</p> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" width="460" bgcolor="#EEFFCA"> <tr> <td width="100%"><font size="6" color="#008000">&nbsp;Date Example</font></td> </tr> <tr> <td width="100%"><b>&nbsp;Current Date and time is:&nbsp; <font color="#FF0000"> <%= new java.util.Date() %> 2nd JSP tag </font></b></td> </tr> </table> </center> </div> </body> </html> 10
  • 11. Another Example Create a simple HTML page having the following output : Select Your Sport : Cricket Basketball Soccer Rugby Hockey 11
  • 12. JSP Coding Part • <html> <body> <%! String[] sports; %> <center>You have selected: <% sports = request.getParameterValues("sports"); if (sports != null) { for (int i = 0; i < sports.length; i++) { out.println ("<b>"+sports[i]+"<b>"); } } else out.println ("<b>none<b>"); %> </center> </body> </html> 12
  • 13. The Output You have selected: Cricket Soccer 13
  • 14. That Was Easy .. • So with the help of some simple examples we saw the Power of JSP. One can make JSP work the way he/she wants and develop a full fledged web app with it .. So , CODE & DESIGN .. The world is all yours.. 14
  • 15. Thank You  Presented By :- Apoorv Anand @APo_ORV 15