SlideShare une entreprise Scribd logo
1  sur  13
JSP




      http://www.java2all.com
Chapter 1



JSP Introduction



                   http://www.java2all.com
Introduction to JSP



                      http://www.java2all.com
JSP :
    Jsp stands for “Java server page”.
    JSP are built by SUN Microsystem.

    JSP enable the developers to directly insert java
 code into jsp file, this makes the development
 process very simple and its maintenance also
 becomes very easy.

    JSP simply place JAVA inside the HTML pages
 means it’s an embedded of html tag and jsp’s own
 tag.
                                           http://www.java2all.com
The extension of jsp page is ".jsp”

     Java is known for its characteristic of
"write once, run anywhere." and JSP page is a
combination of java code into html file so we
can say that the JSP pages are platform
independent means .jsp pages can run in any
platform.



                                          http://www.java2all.com
NOTE :

      We are using here MyEclipse 7.1 an enterprise
edition for developing the jsp files in any web project.
You can visit the VIDEO/PPT of our site for detail of
that IDE (Integrated development environment).
The following example contains the simple html code.

File name: simple.html
     <html>
               <head>
                   <title>web page</title>
                </head>
                <body>
                     <p><b>This is a simple demo of creating a web page.</b><p> <br>
                </body>
     </html>
                                                                          http://www.java2all.com
The output of above program is: This is a
simple demo of creating a web page.

      Now, just change this HTML page extension to
".jsp" instead of ".html" extension so the file name
becomes “simple.jsp” and now it’s became a simple
jsp file.

File name: simple.jsp
     <html>
                <head>
                          <title>web page</title>
                </head>
     <body>
                 <p><b>This is a simple demo of creating a web page.</b><p> <br>
      </body>
     </html>
                                                                          http://www.java2all.com
The output of above program is: This is a
simple demo of creating a web page.

     NOTE : The simple .java file which is run on
server side is called Servlet. For the detail of Servlet
you can visit the Servlet technology in our site.




                                               http://www.java2all.com
JSP Architecture



                   http://www.java2all.com
JSP Architecture :




                     http://www.java2all.com
Steps :
1). The user goes to a JSP page by makes the
request via internet in user’s web browser.

2).   The JSP request is sent to the Web Server.

3). Web server accepts the requested .jsp file and
passes the JSP file to the JSP Servlet Engine.

4). If the JSP file has been called the first time then
the JSP file is parsed otherwise servlet is instantiated.

                                               http://www.java2all.com
5). The next step is to generate a servlet from the
JSP file. In that servlet file, all the HTML code is
converted in println statements.

6). Now, The servlet source code file is compiled
into a class file (bytecode file).

7). The servlet is instantiated by calling the init and
service methods of the servlet’s life cycle.

8). Now, the generated servlet output is sent via the
Internet form web server to user's web browser.

                                             http://www.java2all.com
9). Now in last step, HTML results are
displayed on the user's web browser.




                                         http://www.java2all.com

Contenu connexe

Tendances

Tendances (20)

Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
 
Express js
Express jsExpress js
Express js
 
Java script
Java scriptJava script
Java script
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Servlets
ServletsServlets
Servlets
 
Soap Vs Rest
Soap Vs RestSoap Vs Rest
Soap Vs Rest
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
 
REST API and CRUD
REST API and CRUDREST API and CRUD
REST API and CRUD
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
Introduction to JSON
Introduction to JSONIntroduction to JSON
Introduction to JSON
 
Server Side Programming
Server Side ProgrammingServer Side Programming
Server Side Programming
 
JDBC
JDBCJDBC
JDBC
 
Javascript
JavascriptJavascript
Javascript
 
Jsp
JspJsp
Jsp
 
Ajax Presentation
Ajax PresentationAjax Presentation
Ajax Presentation
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Ajax
AjaxAjax
Ajax
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
 

En vedette (8)

Active server pages
Active server pagesActive server pages
Active server pages
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance Java
 
Active x control
Active x controlActive x control
Active x control
 
Active x
Active xActive x
Active x
 
Jsp element
Jsp elementJsp element
Jsp element
 
Introduction ASP
Introduction ASPIntroduction ASP
Introduction ASP
 
Active Server Page(ASP)
Active Server Page(ASP)Active Server Page(ASP)
Active Server Page(ASP)
 
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
 

Similaire à Jsp chapter 1

Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
WebStackAcademy
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
Adil Jafri
 
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
 
DataBase Connectivity
DataBase ConnectivityDataBase Connectivity
DataBase Connectivity
Akankshaji
 

Similaire à Jsp chapter 1 (20)

Jsp tutorial
Jsp tutorialJsp tutorial
Jsp tutorial
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
 
Wt unit 4
Wt unit 4Wt unit 4
Wt unit 4
 
JAVA SERVER PAGES
JAVA SERVER PAGESJAVA SERVER PAGES
JAVA SERVER PAGES
 
Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course Introduction to the Servlet / JSP course
Introduction to the Servlet / JSP course
 
Jsp in Servlet by Rj
Jsp in Servlet by RjJsp in Servlet by Rj
Jsp in Servlet by Rj
 
Servlet and jsp development with eclipse wtp
Servlet and jsp development with eclipse wtpServlet and jsp development with eclipse wtp
Servlet and jsp development with eclipse wtp
 
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
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
 
Tomcat + other things
Tomcat + other thingsTomcat + other things
Tomcat + other things
 
JSP overview
JSP overviewJSP overview
JSP overview
 
JSP.pptx
JSP.pptxJSP.pptx
JSP.pptx
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - Components
 
Ta Javaserverside Eran Toch
Ta Javaserverside Eran TochTa Javaserverside Eran Toch
Ta Javaserverside Eran Toch
 
Raisa anthony web programming 1st week
Raisa anthony   web programming 1st weekRaisa anthony   web programming 1st week
Raisa anthony web programming 1st week
 
DataBase Connectivity
DataBase ConnectivityDataBase Connectivity
DataBase Connectivity
 
Java server pages
Java server pagesJava server pages
Java server pages
 
Java EE 02-First Servlet
Java EE 02-First ServletJava EE 02-First Servlet
Java EE 02-First Servlet
 

Plus de kamal kotecha

Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
kamal kotecha
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
kamal kotecha
 

Plus de kamal kotecha (20)

Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
 
Java rmi example program with code
Java rmi example program with codeJava rmi example program with code
Java rmi example program with code
 
Java rmi
Java rmiJava rmi
Java rmi
 
Jdbc example program with access and MySql
Jdbc example program with access and MySqlJdbc example program with access and MySql
Jdbc example program with access and MySql
 
Jdbc api
Jdbc apiJdbc api
Jdbc api
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
 
String and string buffer
String and string bufferString and string buffer
String and string buffer
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Packages and inbuilt classes of java
Packages and inbuilt classes of javaPackages and inbuilt classes of java
Packages and inbuilt classes of java
 
Interface
InterfaceInterface
Interface
 
Inheritance chepter 7
Inheritance chepter 7Inheritance chepter 7
Inheritance chepter 7
 
Class method
Class methodClass method
Class method
 
Introduction to class in java
Introduction to class in javaIntroduction to class in java
Introduction to class in java
 
Control statements
Control statementsControl statements
Control statements
 
Jsp myeclipse
Jsp myeclipseJsp myeclipse
Jsp myeclipse
 
basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operator
 

Dernier

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Dernier (20)

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
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
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
 
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
 
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
 
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
 
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
 
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
 
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 Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

Jsp chapter 1

  • 1. JSP http://www.java2all.com
  • 2. Chapter 1 JSP Introduction http://www.java2all.com
  • 3. Introduction to JSP http://www.java2all.com
  • 4. JSP : Jsp stands for “Java server page”. JSP are built by SUN Microsystem. JSP enable the developers to directly insert java code into jsp file, this makes the development process very simple and its maintenance also becomes very easy. JSP simply place JAVA inside the HTML pages means it’s an embedded of html tag and jsp’s own tag. http://www.java2all.com
  • 5. The extension of jsp page is ".jsp” Java is known for its characteristic of "write once, run anywhere." and JSP page is a combination of java code into html file so we can say that the JSP pages are platform independent means .jsp pages can run in any platform. http://www.java2all.com
  • 6. NOTE : We are using here MyEclipse 7.1 an enterprise edition for developing the jsp files in any web project. You can visit the VIDEO/PPT of our site for detail of that IDE (Integrated development environment). The following example contains the simple html code. File name: simple.html <html> <head> <title>web page</title> </head> <body> <p><b>This is a simple demo of creating a web page.</b><p> <br> </body> </html> http://www.java2all.com
  • 7. The output of above program is: This is a simple demo of creating a web page. Now, just change this HTML page extension to ".jsp" instead of ".html" extension so the file name becomes “simple.jsp” and now it’s became a simple jsp file. File name: simple.jsp <html> <head> <title>web page</title> </head> <body> <p><b>This is a simple demo of creating a web page.</b><p> <br> </body> </html> http://www.java2all.com
  • 8. The output of above program is: This is a simple demo of creating a web page. NOTE : The simple .java file which is run on server side is called Servlet. For the detail of Servlet you can visit the Servlet technology in our site. http://www.java2all.com
  • 9. JSP Architecture http://www.java2all.com
  • 10. JSP Architecture : http://www.java2all.com
  • 11. Steps : 1). The user goes to a JSP page by makes the request via internet in user’s web browser. 2). The JSP request is sent to the Web Server. 3). Web server accepts the requested .jsp file and passes the JSP file to the JSP Servlet Engine. 4). If the JSP file has been called the first time then the JSP file is parsed otherwise servlet is instantiated. http://www.java2all.com
  • 12. 5). The next step is to generate a servlet from the JSP file. In that servlet file, all the HTML code is converted in println statements. 6). Now, The servlet source code file is compiled into a class file (bytecode file). 7). The servlet is instantiated by calling the init and service methods of the servlet’s life cycle. 8). Now, the generated servlet output is sent via the Internet form web server to user's web browser. http://www.java2all.com
  • 13. 9). Now in last step, HTML results are displayed on the user's web browser. http://www.java2all.com