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="*">.

AttributeDescription
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

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements