Jsp setProperty

Prev Tutorial Next Tutorial

Jsp setProperty

This action tag is to set an input value to set input value to a property on a variable of bean class by calling setter () method of the property.

When use JSP setPriority tag

When a request comes from browser, the protocol is http and it is unknown for the java bean. So, directly input values from browser canít be send to a java bean.

The flow of setting input values is, a jsp page takes request from browser and it will set input values to bean using tag.

<jsp:setProperty> must be used inside <jsp:useBean> tag.

<jsp:setProperty> property contains four attributes, they are;

Name and property attributes are mandatory. We shouldn't use param and value attribute at time.

If request parameters names and variable name of java beans or matched then we can directly write <protperty="*">.

NameObject name: The values of this attribute must be same as the value of id of the bean class
Propertyvariable name in bean class
Paramrequest parameter name
Valuestatic value
Name, property,valueallowed
Name ,property, paramallowed
Property, paramnot allowed
Name, property,name, paramnot allowed.

Prev Tutorial Next Tutorial

Facebook Likes