Three Tags of Javabean

xiaoxiao2021-03-06  58

i. This tag is used to declare and instantiate the JavaBean class. The syntax is as follows:

ID = "Object-name"

Scope = "Page | Session | Application"

TYPE = "type-of-object"

Class = "full-qualified-classname"

Beanname = "full-qualified-beanname"

/> Let's take a look at these properties:

ID - The name of the object, such as: string name = null; in this code, Name is ID;

Scope - an optional property that when your JavaBean object will be destroyed, the default is Page, he means that each page will create a new JavaBean;

Type - The type of object can be the same class or parent class or the interface to be executed, his parameters are optional. Such as: string name = "faisal khan"; String is what we talk about .

Class - a completely qualified class such as: DATE D = new java.util.date (); java.util.date is what we said.

Beanname - is also a class completely qualified;

II. This tag is used to design the value of javabean, the syntax is as follows:

Name = "id-of-the-javabean"

Property = "Name-of-Property"

Param = "name-of-required-parameter-to-use"

Value = "new-value-of-this-protety"

/> The attribute is:

Name - 'ID' of you set

Property - the name of the Property you want to set

PARAM - the name of Param you want to request in your property

Value --- New value you want to set in this property

III. This tag is used to return a specific Property from a specific JavaBean, the syntax is as follows:

Name = "name-of-the-object"

Property = "Name-of-Property"

/> Properties: Name -

Property - the name of the Property you want to retrieve

Ok, we now complete the JSP tags of learning operation Javabean, let us take some time to learn what is scope attribute:

Every JavaBean class object or other class object has a scope, what he means to keep how long this object is kept in memory, here there are four scopes:

Page - He means a new object will be created or destroyed at each page level. When you don't make a clear given other values, he is default.

REQUEST -

转载请注明原文地址:https://www.9cbs.com/read-90187.html

New Post(0)