SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

19servlets
19servlets19servlets
19servlets
Adil Jafri
 
Jsp
JspJsp
Jsp
Rajavel Dhandabani
 
WEB TECHNOLOGIES JSP
WEB TECHNOLOGIES  JSPWEB TECHNOLOGIES  JSP
WEB TECHNOLOGIES JSP
Jyothishmathi Institute of Technology and Science Karimnagar
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
ejjavies
 
Ch. 8 script free pages
Ch. 8 script free pagesCh. 8 script free pages
Ch. 8 script free pages
Manolis Vavalis
 
Being a jsp
Being a jsp     Being a jsp
Being a jsp
Manolis Vavalis
 
Ch. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryCh. 9 jsp standard tag library
Ch. 9 jsp standard tag library
Manolis Vavalis
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
BG Java EE Course
 
Ch. 7 beeing a jsp
Ch. 7 beeing a jsp     Ch. 7 beeing a jsp
Ch. 7 beeing a jsp
Manolis 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 2010
Arun Gupta
 
Jsp tutorial
Jsp tutorialJsp tutorial
Jsp tutorial
siddhesh2466
 
15 expression-language
15 expression-language15 expression-language
15 expression-language
snopteck
 
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
4η διάλεξη Τεχνολογίες Παγκόσμιου Ιστού
Manolis Vavalis
 
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
baabtra.com - No. 1 supplier of quality freshers
 
C:\fakepath\jsp01
C:\fakepath\jsp01C:\fakepath\jsp01
C:\fakepath\jsp01
Subhasis Nayak
 
Wt unit 4
Wt unit 4Wt unit 4
Wt unit 4
team11vgnt
 
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-directive
snopteck
 
Aem best practices
Aem best practicesAem best practices
Aem best practices
Jitendra Tomar
 
Wt unit 3
Wt unit 3 Wt unit 3
Wt unit 3
team11vgnt
 
Servlets and jsp pages best practices
Servlets and jsp pages best practicesServlets and jsp pages best practices
Servlets and jsp pages best practices
ejjavies
 
Ch. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryCh. 9 jsp standard tag library
Ch. 9 jsp standard tag library
Manolis 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 2010
Arun Gupta
 
15 expression-language
15 expression-language15 expression-language
15 expression-language
snopteck
 
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-directive
snopteck
 

Similar to Java server pages (20)

Jsp abes new
Jsp abes newJsp abes new
Jsp abes new
Ashwin Perti
 
Analysis
AnalysisAnalysis
Analysis
venkatesh anantha
 
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
 
Java Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHatJava Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHat
Scholarhat
 
Java Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHatJava Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHat
Scholarhat
 
Agile Software Development by Sencha
Agile Software Development by SenchaAgile Software Development by Sencha
Agile Software Development by Sencha
Lael Rukius
 
JavaScript Toolkit
JavaScript ToolkitJavaScript Toolkit
JavaScript Toolkit
Robert MacLean
 
Jsp Comparison
 Jsp Comparison Jsp Comparison
Jsp Comparison
Venky Sadasivam
 
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
Nayden 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
 
Java
JavaJava
Java
PriyaKarnan3
 
Jsp(java server pages)
Jsp(java server pages)Jsp(java server pages)
Jsp(java server pages)
Khan Mac-arther
 
Jsp
JspJsp
Jsp
Khan Mac-arther
 
Devjyotippt
DevjyotipptDevjyotippt
Devjyotippt
Gaurav pathak
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
josemachoco
 
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
Remote Stacx
 
Spatial approximate string search Doc
Spatial approximate string search DocSpatial approximate string search Doc
Spatial approximate string search Doc
Sudha Hari Tech Solution Pvt ltd
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
dhananajay95
 
Java ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitionsJava ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitions
ganeshkarthy
 
Raisa anthony web programming 1st week
Raisa anthony   web programming 1st weekRaisa anthony   web programming 1st week
Raisa anthony web programming 1st week
Raisa Anjani
 
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
 
Java Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHatJava Full Stack Developer Interview Questions PDF By ScholarHat
Java Full Stack Developer Interview Questions PDF By ScholarHat
Scholarhat
 
Java Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHatJava Developer Roadmap PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHat
Scholarhat
 
Agile Software Development by Sencha
Agile Software Development by SenchaAgile Software Development by Sencha
Agile Software Development by Sencha
Lael 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 Spring
Nayden 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 Java
josemachoco
 
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
Remote Stacx
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
dhananajay95
 
Java ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitionsJava ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitions
ganeshkarthy
 
Raisa anthony web programming 1st week
Raisa anthony   web programming 1st weekRaisa anthony   web programming 1st week
Raisa anthony web programming 1st week
Raisa Anjani
 
Ad

Recently uploaded (20)

How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Cultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptxCultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptx
UmeshTimilsina1
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)
Mohamed Rizk Khodair
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...Transform tomorrow: Master benefits analysis with Gen AI today webinar,  30 A...
Transform tomorrow: Master benefits analysis with Gen AI today webinar, 30 A...
Association for Project Management
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Cultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptxCultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptx
UmeshTimilsina1
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)Myasthenia gravis (Neuromuscular disorder)
Myasthenia gravis (Neuromuscular disorder)
Mohamed Rizk Khodair
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
UPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guideUPMVLE migration to ARAL. A step- by- step guide
UPMVLE migration to ARAL. A step- by- step guide
abmerca
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
Ancient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian HistoryAncient Stone Sculptures of India: As a Source of Indian History
Ancient Stone Sculptures of India: As a Source of Indian History
Virag Sontakke
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
*"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"**"Sensing the World: Insect Sensory Systems"*
*"Sensing the World: Insect Sensory Systems"*
Arshad Shaikh
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
Ad

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
  翻译: