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

PPTX
Spring beans
PDF
13 java beans
PPTX
Java component
PPTX
Jsp session 5
PDF
Designing and Implementing a Multiuser Apps Platform
PPTX
Java beans
PPT
Spring framework
PPT
Beans presentation
Spring beans
13 java beans
Java component
Jsp session 5
Designing and Implementing a Multiuser Apps Platform
Java beans
Spring framework
Beans presentation

Similar to Jsp session 6 (15)

PPTX
Session 4 - Understanding JAVA Beans.pptx
PPTX
Advance java session 12
PPT
Jsp Presentation +Mufix "3"
PPTX
Learning jsp
PPT
JSP Part 2
DOCX
PPTX
ADP - Chapter 5 Exploring JavaServer Pages Technology
DOC
Jsp advance part i
PPTX
JSP.pptx programming guide for beginners and experts
PPSX
Java server pages
PPTX
4. jsp
PDF
Using java beans(ii)
TXT
Jsp Notes
Session 4 - Understanding JAVA Beans.pptx
Advance java session 12
Jsp Presentation +Mufix "3"
Learning jsp
JSP Part 2
ADP - Chapter 5 Exploring JavaServer Pages Technology
Jsp advance part i
JSP.pptx programming guide for beginners and experts
Java server pages
4. jsp
Using java beans(ii)
Jsp Notes
Ad

More from Anuj Singh Rajput (20)

PPTX
Web technology
PPTX
Java script
PPTX
Html (hypertext markup language)
PPTX
PPTX
Jsp session 13
PPTX
Jsp session 12
PPTX
Jsp session 11
PPTX
Jsp session 10
PPTX
Jsp session 9
PPTX
Jsp session 8
PPTX
Jsp session 7
PPTX
Jsp session 4
PPTX
Jsp session 3
PPTX
Jsp session 2
PPTX
Jsp session 1
PPTX
Servlet session 14
PPTX
Servlet session 13
PPTX
Servlet session 12
PPTX
Servlet session 11
Web technology
Java script
Html (hypertext markup language)
Jsp session 13
Jsp session 12
Jsp session 11
Jsp session 10
Jsp session 9
Jsp session 8
Jsp session 7
Jsp session 4
Jsp session 3
Jsp session 2
Jsp session 1
Servlet session 14
Servlet session 13
Servlet session 12
Servlet session 11
Ad

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PPTX
Cell Structure & Organelles in detailed.
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Classroom Observation Tools for Teachers
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Insiders guide to clinical Medicine.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
Cell Types and Its function , kingdom of life
Cell Structure & Organelles in detailed.
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
01-Introduction-to-Information-Management.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Module 4: Burden of Disease Tutorial Slides S2 2025
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Classroom Observation Tools for Teachers
TR - Agricultural Crops Production NC III.pdf
Microbial disease of the cardiovascular and lymphatic systems
VCE English Exam - Section C Student Revision Booklet
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Insiders guide to clinical Medicine.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Abdominal Access Techniques with Prof. Dr. R K Mishra

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>