SlideShare a Scribd company logo
SESSION – 6
By→ Anuj Kumar Singh
JSP useBean Action:
useBean action tag is used to locate or instantiate a bean class. If bean
object of the Bean class is already created, it doesn't create the bean
depending on the scope. But if object of bean is not created, it
instantiates the bean.
Attributes and Usage of jsp: useBean action tag
1. id: is used to identify the bean in the specific scope.
2. scope: represents the scope of the bean. It may be page, request,
session or application.
a. page: specifies that you can use this bean within the JSP page. The
default scope is page.
b. request: specifies that you can use this bean from any JSP page that
processes the same request. It has wider scope than page.
c. session: specifies that you can use this bean from any JSP page in
the same session whether processes the same request or not. It has
wider scope than request.
d. application: specifies that you can use this bean from any JSP page
in the same application. It has wider scope than session.
3. class: instantiates the specified bean class (i.e. creates an object of
the bean class) but it must have no-arg or no constructor and must
not be abstract.
4. type: provides the bean a data type if the bean already exists in the
scope. It is mainly used with class or beanName attribute. If you use
it without class or beanName, no bean is instantiated.
5. beanName: instantiates the bean using the java.beans.Beans.instantiate()
method.
JSP setProperty and JSP getProperty action Tag
1. The setProperty and getProperty action tags are used for developing web
application with Java Bean. In web devlopment, bean class is mostly used
because it is a reusable software component that represents data.
2. The jsp:setProperty action tag sets a property value or values in a bean
using the setter method.
Displaying Applet in JSP
The jsp:plugin action tag is used to embed applet in the jsp file. The
jsp:plugin action tag downloads plugin at client side to execute an
applet or bean.
<jsp:plugin type= "applet | bean" code= "nameOfClassFile"
codebase= "directoryNameOfClassFile"
</jsp:plugin>
Jsp   session 6

More Related Content

Similar to Jsp session 6

WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
introduction of Java beans
introduction of Java beansintroduction of Java beans
introduction of Java beans
shravan kumar upadhayay
 
Java beans
Java beansJava beans
Java beans
sptatslide
 
Javabeans .pdf
Javabeans .pdfJavabeans .pdf
Javabeans .pdf
Rajkiran Mummadi
 
Jsp
JspJsp
Advance java session 12
Advance java session 12Advance java session 12
Advance java session 12
Smita B Kumar
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
Hitesh Parmar
 
Spring by rj
Spring by rjSpring by rj
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions
Dhiraj Champawat
 
JSP Part 2
JSP Part 2JSP Part 2
JSP Part 2
DeeptiJava
 
Jsp advance part i
Jsp advance part iJsp advance part i
Jsp advance part i
sameersaxena90
 
How to use the java bean api library
How to use the java bean api libraryHow to use the java bean api library
How to use the java bean api library
nishajj
 
How to use the java bean api library
How to use the java bean api libraryHow to use the java bean api library
How to use the java bean api library
nishajj
 
Session 44 - Spring - Part 2 - Autowiring, Annotations, Java based Configuration
Session 44 - Spring - Part 2 - Autowiring, Annotations, Java based ConfigurationSession 44 - Spring - Part 2 - Autowiring, Annotations, Java based Configuration
Session 44 - Spring - Part 2 - Autowiring, Annotations, Java based Configuration
PawanMM
 
Java server pages
Java server pagesJava server pages
Java server pages
Tanmoy Barman
 
java beans
java beansjava beans
java beans
lapa
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
Emprovise
 
Using java beans(ii)
Using java beans(ii)Using java beans(ii)
Using java beans(ii)
Ximentita Hernandez
 
SpringIntroductionpresentationoverintroduction.ppt
SpringIntroductionpresentationoverintroduction.pptSpringIntroductionpresentationoverintroduction.ppt
SpringIntroductionpresentationoverintroduction.ppt
imjdabhinawpandey
 
4. jsp
4. jsp4. jsp
4. jsp
AnusAhmad
 

Similar to Jsp session 6 (20)

WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
 
introduction of Java beans
introduction of Java beansintroduction of Java beans
introduction of Java beans
 
Java beans
Java beansJava beans
Java beans
 
Javabeans .pdf
Javabeans .pdfJavabeans .pdf
Javabeans .pdf
 
Jsp
JspJsp
Jsp
 
Advance java session 12
Advance java session 12Advance java session 12
Advance java session 12
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
 
Spring by rj
Spring by rjSpring by rj
Spring by rj
 
02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions02 java spring-hibernate-experience-questions
02 java spring-hibernate-experience-questions
 
JSP Part 2
JSP Part 2JSP Part 2
JSP Part 2
 
Jsp advance part i
Jsp advance part iJsp advance part i
Jsp advance part i
 
How to use the java bean api library
How to use the java bean api libraryHow to use the java bean api library
How to use the java bean api library
 
How to use the java bean api library
How to use the java bean api libraryHow to use the java bean api library
How to use the java bean api library
 
Session 44 - Spring - Part 2 - Autowiring, Annotations, Java based Configuration
Session 44 - Spring - Part 2 - Autowiring, Annotations, Java based ConfigurationSession 44 - Spring - Part 2 - Autowiring, Annotations, Java based Configuration
Session 44 - Spring - Part 2 - Autowiring, Annotations, Java based Configuration
 
Java server pages
Java server pagesJava server pages
Java server pages
 
java beans
java beansjava beans
java beans
 
Enterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business LogicEnterprise Java Beans 3 - Business Logic
Enterprise Java Beans 3 - Business Logic
 
Using java beans(ii)
Using java beans(ii)Using java beans(ii)
Using java beans(ii)
 
SpringIntroductionpresentationoverintroduction.ppt
SpringIntroductionpresentationoverintroduction.pptSpringIntroductionpresentationoverintroduction.ppt
SpringIntroductionpresentationoverintroduction.ppt
 
4. jsp
4. jsp4. jsp
4. jsp
 

More from Anuj Singh Rajput

Web technology
Web technologyWeb technology
Web technology
Anuj Singh Rajput
 
Java script
Java scriptJava script
Java script
Anuj Singh Rajput
 
Html (hypertext markup language)
Html (hypertext markup language)Html (hypertext markup language)
Html (hypertext markup language)
Anuj Singh Rajput
 
Css
CssCss
Bootstrap
BootstrapBootstrap
Jsp session 13
Jsp   session 13Jsp   session 13
Jsp session 13
Anuj Singh Rajput
 
Jsp session 12
Jsp   session 12Jsp   session 12
Jsp session 12
Anuj Singh Rajput
 
Jsp session 11
Jsp   session 11Jsp   session 11
Jsp session 11
Anuj Singh Rajput
 
Jsp session 10
Jsp   session 10Jsp   session 10
Jsp session 10
Anuj Singh Rajput
 
Jsp session 9
Jsp   session 9Jsp   session 9
Jsp session 9
Anuj Singh Rajput
 
Jsp session 8
Jsp   session 8Jsp   session 8
Jsp session 8
Anuj Singh Rajput
 
Jsp session 7
Jsp   session 7Jsp   session 7
Jsp session 7
Anuj Singh Rajput
 
Jsp session 4
Jsp   session 4Jsp   session 4
Jsp session 4
Anuj Singh Rajput
 
Jsp session 3
Jsp   session 3Jsp   session 3
Jsp session 3
Anuj Singh Rajput
 
Jsp session 2
Jsp   session 2Jsp   session 2
Jsp session 2
Anuj Singh Rajput
 
Jsp session 1
Jsp   session 1Jsp   session 1
Jsp session 1
Anuj Singh Rajput
 
Servlet session 14
Servlet   session 14Servlet   session 14
Servlet session 14
Anuj Singh Rajput
 
Servlet session 13
Servlet   session 13Servlet   session 13
Servlet session 13
Anuj Singh Rajput
 
Servlet session 12
Servlet   session 12Servlet   session 12
Servlet session 12
Anuj Singh Rajput
 
Servlet session 11
Servlet   session 11Servlet   session 11
Servlet session 11
Anuj Singh Rajput
 

More from Anuj Singh Rajput (20)

Web technology
Web technologyWeb technology
Web technology
 
Java script
Java scriptJava script
Java script
 
Html (hypertext markup language)
Html (hypertext markup language)Html (hypertext markup language)
Html (hypertext markup language)
 
Css
CssCss
Css
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Jsp session 13
Jsp   session 13Jsp   session 13
Jsp session 13
 
Jsp session 12
Jsp   session 12Jsp   session 12
Jsp session 12
 
Jsp session 11
Jsp   session 11Jsp   session 11
Jsp session 11
 
Jsp session 10
Jsp   session 10Jsp   session 10
Jsp session 10
 
Jsp session 9
Jsp   session 9Jsp   session 9
Jsp session 9
 
Jsp session 8
Jsp   session 8Jsp   session 8
Jsp session 8
 
Jsp session 7
Jsp   session 7Jsp   session 7
Jsp session 7
 
Jsp session 4
Jsp   session 4Jsp   session 4
Jsp session 4
 
Jsp session 3
Jsp   session 3Jsp   session 3
Jsp session 3
 
Jsp session 2
Jsp   session 2Jsp   session 2
Jsp session 2
 
Jsp session 1
Jsp   session 1Jsp   session 1
Jsp session 1
 
Servlet session 14
Servlet   session 14Servlet   session 14
Servlet session 14
 
Servlet session 13
Servlet   session 13Servlet   session 13
Servlet session 13
 
Servlet session 12
Servlet   session 12Servlet   session 12
Servlet session 12
 
Servlet session 11
Servlet   session 11Servlet   session 11
Servlet session 11
 

Recently uploaded

Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 

Recently uploaded (20)

Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 

Jsp session 6

  • 1. SESSION – 6 By→ Anuj Kumar Singh
  • 2. JSP useBean Action: useBean action tag is used to locate or instantiate a bean class. If bean object of the Bean class is already created, it doesn't create the bean depending on the scope. But if object of bean is not created, it instantiates the bean. Attributes and Usage of jsp: useBean action tag 1. id: is used to identify the bean in the specific scope. 2. scope: represents the scope of the bean. It may be page, request, session or application. a. page: specifies that you can use this bean within the JSP page. The default scope is page.
  • 3. b. request: specifies that you can use this bean from any JSP page that processes the same request. It has wider scope than page. c. session: specifies that you can use this bean from any JSP page in the same session whether processes the same request or not. It has wider scope than request. d. application: specifies that you can use this bean from any JSP page in the same application. It has wider scope than session. 3. class: instantiates the specified bean class (i.e. creates an object of the bean class) but it must have no-arg or no constructor and must not be abstract. 4. type: provides the bean a data type if the bean already exists in the scope. It is mainly used with class or beanName attribute. If you use it without class or beanName, no bean is instantiated.
  • 4. 5. beanName: instantiates the bean using the java.beans.Beans.instantiate() method. JSP setProperty and JSP getProperty action Tag 1. The setProperty and getProperty action tags are used for developing web application with Java Bean. In web devlopment, bean class is mostly used because it is a reusable software component that represents data. 2. The jsp:setProperty action tag sets a property value or values in a bean using the setter method.
  • 5. Displaying Applet in JSP The jsp:plugin action tag is used to embed applet in the jsp file. The jsp:plugin action tag downloads plugin at client side to execute an applet or bean. <jsp:plugin type= "applet | bean" code= "nameOfClassFile" codebase= "directoryNameOfClassFile" </jsp:plugin>