SlideShare a Scribd company logo
1 of 23
Ayes Chinmay
Internet
&
Web Technology
(JSP)
IWT Syllabus:
Module 5:
Node.js
Introduction, Modules in nodejs, HTTP module, File System, URL module, NPM, events, Upload Files,
Email.
JSP
Server Side Programming: Introduction to Java Server Page (JSP), JSP Application Design, JSP objects,
Conditional Processing, Declaring variables and methods, Sharing data between JSP pages, Sharing
Session and Application Data, Database Programming using JDBC, development of java beans in JSP.
Servlet
Introduction to Servlets, Lifecycle, JSDK, Servlet API, Servlet Packages, Introduction to JSF, JSF Basics,
Managed Beans, Navigation, Standard JSF Tags, Data Tables, Conversion and Validation, Event Handling
JSP (Java Server Page):
• JSP is a server-side programming technology.
• Developed by Sun Microsystems in 1999.
• Fast way to create web pages to display dynamic data.
• JSP page contains both static & dynamic data.
• Helps to write web applications easily even with a less knowledge in Java.
• Extension of a JSP page is .jsp or .jspx
• Initially JSP was developed to replace servlet but now common practice is to
use servlet and JSP together using MVC (model-view-controller) pattern.
JSP Architecture:
Client’s
Computer
Server
1.Browser requests HTML
7. Server sends HTML
back to browser
servlet
servlet
class 5.The servlet
runs and
generates
HTML
Java Engine
6. Java Engine sends HTML toserver
2. Server sends requests to Java Engine
3. If needed, the Java Engine
reads the .jsp file
4. The JSP is turned intoa
servlet, compiled, and loaded
Bean JSP
JSP Life Cycle:
[destroy]
jspDestroy()
[Execution ]
_jspService()
[Intialization]
jspInit()
Request
Response
JSP Scripting Elements:
 There are three types of scripting elements in JSP,
o Scriptlet tag
o Expression tag
o Declaration tag
JSP Scriptlet tag:
 In JSP, JAVA code can be written inside the JSP page using
Scriptlet tag.
Syntax: <% java source code %>
Example:
<html>
<body>
<% out.print(“Hello world…”); %>
</body>
</html>
JSP Expression tag:
 Code placed within expression tag is written to the output stream of the
response. So, no need to write out.print() to write data.
Syntax: <%= Statement %>
Example:
<html>
<body>
<%= “Hello world!” %>
</body>
</html>
Note: Do not end statement with semicolon (;)
JSP Declaration tag:
 Used to declare fields and methods. The code written inside
this tag is placed outside the service() method of auto
generated servlet. So it doesn’t get memory at each request.
Syntax: <%! Statement %>
Example:
<html>
<body>
<%! int data=60; %>
<%= “Value is: “ + data %>
</body>
</html>
JSP Comments:
 There are two types of JSP comment types that we are using.
 Hidden Comments (JSP comments)
o Visible only inside JSP page but not in the generated HTML
page
o Example:
<%-- This is a hidden JSP comment --%>
 Comments within HTML content
o Comments to be generated inside the output HTML page
o Example:
<!-- Comment inside the generated HTML -->
JSP Directives:
• Directives are messages that tells the web container how to
translate a JSP page into corresponding servlet.
• Three types:
 page directive
 include directive
 taglib directive
• Syntax of JSP directives
<%@ directive attribute=“value” %>
JSP page directive:
• Defines attributes that apply to an entire JSP page.
• Syntax:
<%@ page attribute=“value” %>
• Attributes :
import, contentType, extends, info, buffer, language, autoFlush, session,
pageEncoding, errorPage, isErrorPage
JSP include directive:
• Includes the contents of any resource(may be jsp file, html
file or text file.
• It includes the original content of the included
resources at page translation time.
• Reusability is the advantage.
• Syntax:
<%@include file=“resourcename” %>
JSP taglib directive:
• Used to define a tag library that defines many tags.
• We use the TLD (Tag Library Descriptor) file to define the
tags.
• Syntax:
<%@ taglib uri=“uriofthetaglibrary”
prefix=“prefixoftaglibrary” %>
JSP implicit objects:
 There are several objects that are automatically available in JSP
called implicit objects.
Variable Type
out JspWriter
request HTTPServletRequest
response HTTPServletResponse
config ServletConfig
application ServletContext
session HTTPSession
pageContext PageContext
page Object
exception Throwable
JSP Scriptlet tag (Scripting elements):
<html>
<body>
<form action="welcome.jsp">
<input type="text" name="uname">
<input type="submit" value="go"><br/>
</form>
</body>
</html>
Index.html <html>
<body>
<%
String name=request.getParameter(
"uname");
out.print("welcome "+name);
%>
</body>
</html>
welcome.jsp
http://localhost:8080/
JSP Expression Tag:
<html>
<body>
<form action="welcome.jsp">
<input type="text" name="uname">
<br/>
<input type="submit" value="go">
</form>
</body>
</html>
Index.html
<html>
<body>
<%= "Welcome
"+request.getParameter("uname")
%>
</body>
</html>
welcome.jsp
JSP Declaration Tag:
<html>
<body>
<%! int data=50; %>
<%= "Value of the variable is:"+data %>
</body>
</html>
welcome.jsp
JSP Directives:
<html>
<body>
<%@ page import="java.util.Date" %>
Today is: <%= new Date() %>
</body>
</html>
Index.jsp
JSP request implicit object:
<form action="index1.jsp">
<input type="text" name="uname">
<input type="submit" value="go"><br/>
</form>
Index.html <%
String
name=request.getParameter("una
me");
out.print("welcome "+name);
%>
index1.jsp
Model Questions:
1. By which technology do we separate our business logic from
the presentation logic?
a) Servlet
b) JSP
c) Both (a) and (b)
d) None of the above (NIC 2016)
2. The correct syntax to write "Hi" in Javascript is
a) jscript.write("Hi");
b) document.write("Hi");
c) print("Hi");
d) jscript.print("Hi"); (ISRO 2015)
Model Questions: (Cont.)
3. XML document form a ______ structure ?
(a) Binary Tree
(b) Linked List
(c) Tree
(d) Graph
4. Which of the following provides a method to avoid
element name conflicts in XML ?
(a) Namespaces
(b) DTD
(c) CSS
(d) DOM
(JT 2018)
(JT 2018)
Next Class:
Servlet

More Related Content

What's hot (20)

Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
Wt unit 6 ppts web services
Wt unit 6 ppts web servicesWt unit 6 ppts web services
Wt unit 6 ppts web services
 
Internet and Web Technology (CLASS-6) [BOM]
Internet and Web Technology (CLASS-6) [BOM] Internet and Web Technology (CLASS-6) [BOM]
Internet and Web Technology (CLASS-6) [BOM]
 
Wt unit 2 ppts client side technology
Wt unit 2 ppts client side technologyWt unit 2 ppts client side technology
Wt unit 2 ppts client side technology
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Introduction to java_script
Introduction to java_scriptIntroduction to java_script
Introduction to java_script
 
Suggest.js
Suggest.jsSuggest.js
Suggest.js
 
Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
JS basics
JS basicsJS basics
JS basics
 
Wt unit 5 client &amp; server side framework
Wt unit 5 client &amp; server side frameworkWt unit 5 client &amp; server side framework
Wt unit 5 client &amp; server side framework
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Class Intro / HTML Basics
Class Intro / HTML BasicsClass Intro / HTML Basics
Class Intro / HTML Basics
 
Web components
Web componentsWeb components
Web components
 
Introduction to Javascript By Satyen
Introduction to Javascript By  SatyenIntroduction to Javascript By  Satyen
Introduction to Javascript By Satyen
 
Wt unit 4 server side technology-2
Wt unit 4 server side technology-2Wt unit 4 server side technology-2
Wt unit 4 server side technology-2
 
Java script programs
Java script programsJava script programs
Java script programs
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQuery
 
JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
 
Java script
Java scriptJava script
Java script
 
Wt unit 4
Wt unit 4Wt unit 4
Wt unit 4
 

Similar to Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology

Similar to Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology (20)

Jsp
JspJsp
Jsp
 
JSP.pptx
JSP.pptxJSP.pptx
JSP.pptx
 
Introduction to JSP.pptx
Introduction to JSP.pptxIntroduction to JSP.pptx
Introduction to JSP.pptx
 
Jsp in Servlet by Rj
Jsp in Servlet by RjJsp in Servlet by Rj
Jsp in Servlet by Rj
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
JSP - Java Server Page
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server Page
 
Jsp
JspJsp
Jsp
 
Jsp Introduction Tutorial
Jsp Introduction TutorialJsp Introduction Tutorial
Jsp Introduction Tutorial
 
Chap4 4 2
Chap4 4 2Chap4 4 2
Chap4 4 2
 
Jsp
JspJsp
Jsp
 
Java Web Programming [4/9] : JSP Basic
Java Web Programming [4/9] : JSP BasicJava Web Programming [4/9] : JSP Basic
Java Web Programming [4/9] : JSP Basic
 
C:\fakepath\jsp01
C:\fakepath\jsp01C:\fakepath\jsp01
C:\fakepath\jsp01
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGES
 
Jsp1
Jsp1Jsp1
Jsp1
 
Jsp sasidhar
Jsp sasidharJsp sasidhar
Jsp sasidhar
 
Spatial approximate string search Doc
Spatial approximate string search DocSpatial approximate string search Doc
Spatial approximate string search Doc
 
Jsp
JspJsp
Jsp
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - Components
 
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)Lecture 4:  JavaServer Pages (JSP) & Expression Language (EL)
Lecture 4: JavaServer Pages (JSP) & Expression Language (EL)
 
10 jsp-scripting-elements
10 jsp-scripting-elements10 jsp-scripting-elements
10 jsp-scripting-elements
 

More from Ayes Chinmay

Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Ayes Chinmay
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Ayes Chinmay
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Ayes Chinmay
 
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web TechnologyAyes Chinmay
 
Internet and Web Technology (CLASS-5) [HTML DOM]
Internet and Web Technology (CLASS-5) [HTML DOM] Internet and Web Technology (CLASS-5) [HTML DOM]
Internet and Web Technology (CLASS-5) [HTML DOM] Ayes Chinmay
 
Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS] Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS] Ayes Chinmay
 
Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS] Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS] Ayes Chinmay
 
Internet and Web Technology (CLASS-2) [HTTP & HTML]
Internet and Web Technology (CLASS-2) [HTTP & HTML]Internet and Web Technology (CLASS-2) [HTTP & HTML]
Internet and Web Technology (CLASS-2) [HTTP & HTML]Ayes Chinmay
 
Internet and Web Technology (CLASS-1) [Introduction]
Internet and Web Technology (CLASS-1) [Introduction]Internet and Web Technology (CLASS-1) [Introduction]
Internet and Web Technology (CLASS-1) [Introduction]Ayes Chinmay
 

More from Ayes Chinmay (9)

Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
 
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
Internet and Web Technology (CLASS-8) [jQuery and JSON] | NIC/NIELIT Web Tech...
 
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web TechnologyInternet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
 
Internet and Web Technology (CLASS-5) [HTML DOM]
Internet and Web Technology (CLASS-5) [HTML DOM] Internet and Web Technology (CLASS-5) [HTML DOM]
Internet and Web Technology (CLASS-5) [HTML DOM]
 
Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS] Internet and Web Technology (CLASS-4) [CSS & JS]
Internet and Web Technology (CLASS-4) [CSS & JS]
 
Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS] Internet and Web Technology (CLASS-3) [HTML & CSS]
Internet and Web Technology (CLASS-3) [HTML & CSS]
 
Internet and Web Technology (CLASS-2) [HTTP & HTML]
Internet and Web Technology (CLASS-2) [HTTP & HTML]Internet and Web Technology (CLASS-2) [HTTP & HTML]
Internet and Web Technology (CLASS-2) [HTTP & HTML]
 
Internet and Web Technology (CLASS-1) [Introduction]
Internet and Web Technology (CLASS-1) [Introduction]Internet and Web Technology (CLASS-1) [Introduction]
Internet and Web Technology (CLASS-1) [Introduction]
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology

  • 2. IWT Syllabus: Module 5: Node.js Introduction, Modules in nodejs, HTTP module, File System, URL module, NPM, events, Upload Files, Email. JSP Server Side Programming: Introduction to Java Server Page (JSP), JSP Application Design, JSP objects, Conditional Processing, Declaring variables and methods, Sharing data between JSP pages, Sharing Session and Application Data, Database Programming using JDBC, development of java beans in JSP. Servlet Introduction to Servlets, Lifecycle, JSDK, Servlet API, Servlet Packages, Introduction to JSF, JSF Basics, Managed Beans, Navigation, Standard JSF Tags, Data Tables, Conversion and Validation, Event Handling
  • 3. JSP (Java Server Page): • JSP is a server-side programming technology. • Developed by Sun Microsystems in 1999. • Fast way to create web pages to display dynamic data. • JSP page contains both static & dynamic data. • Helps to write web applications easily even with a less knowledge in Java. • Extension of a JSP page is .jsp or .jspx • Initially JSP was developed to replace servlet but now common practice is to use servlet and JSP together using MVC (model-view-controller) pattern.
  • 4. JSP Architecture: Client’s Computer Server 1.Browser requests HTML 7. Server sends HTML back to browser servlet servlet class 5.The servlet runs and generates HTML Java Engine 6. Java Engine sends HTML toserver 2. Server sends requests to Java Engine 3. If needed, the Java Engine reads the .jsp file 4. The JSP is turned intoa servlet, compiled, and loaded Bean JSP
  • 5. JSP Life Cycle: [destroy] jspDestroy() [Execution ] _jspService() [Intialization] jspInit() Request Response
  • 6. JSP Scripting Elements:  There are three types of scripting elements in JSP, o Scriptlet tag o Expression tag o Declaration tag
  • 7. JSP Scriptlet tag:  In JSP, JAVA code can be written inside the JSP page using Scriptlet tag. Syntax: <% java source code %> Example: <html> <body> <% out.print(“Hello world…”); %> </body> </html>
  • 8. JSP Expression tag:  Code placed within expression tag is written to the output stream of the response. So, no need to write out.print() to write data. Syntax: <%= Statement %> Example: <html> <body> <%= “Hello world!” %> </body> </html> Note: Do not end statement with semicolon (;)
  • 9. JSP Declaration tag:  Used to declare fields and methods. The code written inside this tag is placed outside the service() method of auto generated servlet. So it doesn’t get memory at each request. Syntax: <%! Statement %> Example: <html> <body> <%! int data=60; %> <%= “Value is: “ + data %> </body> </html>
  • 10. JSP Comments:  There are two types of JSP comment types that we are using.  Hidden Comments (JSP comments) o Visible only inside JSP page but not in the generated HTML page o Example: <%-- This is a hidden JSP comment --%>  Comments within HTML content o Comments to be generated inside the output HTML page o Example: <!-- Comment inside the generated HTML -->
  • 11. JSP Directives: • Directives are messages that tells the web container how to translate a JSP page into corresponding servlet. • Three types:  page directive  include directive  taglib directive • Syntax of JSP directives <%@ directive attribute=“value” %>
  • 12. JSP page directive: • Defines attributes that apply to an entire JSP page. • Syntax: <%@ page attribute=“value” %> • Attributes : import, contentType, extends, info, buffer, language, autoFlush, session, pageEncoding, errorPage, isErrorPage
  • 13. JSP include directive: • Includes the contents of any resource(may be jsp file, html file or text file. • It includes the original content of the included resources at page translation time. • Reusability is the advantage. • Syntax: <%@include file=“resourcename” %>
  • 14. JSP taglib directive: • Used to define a tag library that defines many tags. • We use the TLD (Tag Library Descriptor) file to define the tags. • Syntax: <%@ taglib uri=“uriofthetaglibrary” prefix=“prefixoftaglibrary” %>
  • 15. JSP implicit objects:  There are several objects that are automatically available in JSP called implicit objects. Variable Type out JspWriter request HTTPServletRequest response HTTPServletResponse config ServletConfig application ServletContext session HTTPSession pageContext PageContext page Object exception Throwable
  • 16. JSP Scriptlet tag (Scripting elements): <html> <body> <form action="welcome.jsp"> <input type="text" name="uname"> <input type="submit" value="go"><br/> </form> </body> </html> Index.html <html> <body> <% String name=request.getParameter( "uname"); out.print("welcome "+name); %> </body> </html> welcome.jsp http://localhost:8080/
  • 17. JSP Expression Tag: <html> <body> <form action="welcome.jsp"> <input type="text" name="uname"> <br/> <input type="submit" value="go"> </form> </body> </html> Index.html <html> <body> <%= "Welcome "+request.getParameter("uname") %> </body> </html> welcome.jsp
  • 18. JSP Declaration Tag: <html> <body> <%! int data=50; %> <%= "Value of the variable is:"+data %> </body> </html> welcome.jsp
  • 19. JSP Directives: <html> <body> <%@ page import="java.util.Date" %> Today is: <%= new Date() %> </body> </html> Index.jsp
  • 20. JSP request implicit object: <form action="index1.jsp"> <input type="text" name="uname"> <input type="submit" value="go"><br/> </form> Index.html <% String name=request.getParameter("una me"); out.print("welcome "+name); %> index1.jsp
  • 21. Model Questions: 1. By which technology do we separate our business logic from the presentation logic? a) Servlet b) JSP c) Both (a) and (b) d) None of the above (NIC 2016) 2. The correct syntax to write "Hi" in Javascript is a) jscript.write("Hi"); b) document.write("Hi"); c) print("Hi"); d) jscript.print("Hi"); (ISRO 2015)
  • 22. Model Questions: (Cont.) 3. XML document form a ______ structure ? (a) Binary Tree (b) Linked List (c) Tree (d) Graph 4. Which of the following provides a method to avoid element name conflicts in XML ? (a) Namespaces (b) DTD (c) CSS (d) DOM (JT 2018) (JT 2018)