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

More Related Content

PPTX
Java Server Pages
PPTX
JSP Directives
PPTX
Jsp elements
PPS
Jsp chapter 1
PPT
JSP Part 1
PDF
Jsp tutorial (1)
PDF
20jsp
PPT
Deploying java beans in jsp
Java Server Pages
JSP Directives
Jsp elements
Jsp chapter 1
JSP Part 1
Jsp tutorial (1)
20jsp
Deploying java beans in jsp

What's hot (20)

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

Similar to Java server pages (20)

PPT
Jsp abes new
DOCX
PDF
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
PDF
Java Full Stack Developer Interview Questions PDF By ScholarHat
PDF
Java Developer Roadmap PDF By ScholarHat
PPT
Agile Software Development by Sencha
PPTX
JavaScript Toolkit
PPT
Jsp Comparison
PPTX
SoftwareUniversity seminar fast REST Api with Spring
PDF
Javaserver Pages Your Visual Blueprint For Designing Dynamic Content With Jsp...
PPTX
C,c++,java,php,.net training institute in delhi, best training institute for ...
PPTX
PPT
Jsp(java server pages)
PPTX
Devjyotippt
PDF
Overview of Java
PDF
Languages used by web app development services remotestac x
DOC
Spatial approximate string search Doc
PPTX
Advance java prasentation
PPT
Java ppt-class_basic data types methods definitions
Jsp abes new
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
Java Full Stack Developer Interview Questions PDF By ScholarHat
Java Developer Roadmap PDF By ScholarHat
Agile Software Development by Sencha
JavaScript Toolkit
Jsp Comparison
SoftwareUniversity seminar fast REST Api with Spring
Javaserver Pages Your Visual Blueprint For Designing Dynamic Content With Jsp...
C,c++,java,php,.net training institute in delhi, best training institute for ...
Jsp(java server pages)
Devjyotippt
Overview of Java
Languages used by web app development services remotestac x
Spatial approximate string search Doc
Advance java prasentation
Java ppt-class_basic data types methods definitions
Ad

Recently uploaded (20)

PPTX
Institutional Correction lecture only . . .
PPTX
Cell Types and Its function , kingdom of life
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
RMMM.pdf make it easy to upload and study
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Basic Mud Logging Guide for educational purpose
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Institutional Correction lecture only . . .
Cell Types and Its function , kingdom of life
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Anesthesia in Laparoscopic Surgery in India
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
O5-L3 Freight Transport Ops (International) V1.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
RMMM.pdf make it easy to upload and study
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Microbial disease of the cardiovascular and lymphatic systems
TR - Agricultural Crops Production NC III.pdf
Pre independence Education in Inndia.pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Basic Mud Logging Guide for educational purpose
human mycosis Human fungal infections are called human mycosis..pptx
Final Presentation General Medicine 03-08-2024.pptx
Pharma ospi slides which help in ospi learning
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...

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