Hi

I am using the "< jsp:setProperty " tag....

so I want to set the properties manually if the corresponding property field is empty(null) in the web form.

So it was hard corded in the setter method of the bean class.

public void setName(String name) {
if (name == null) {
this.name = " ";
}
else {
this.name = name;
}
}


but this is also not working. That is when the given name field is empty, the created object still has null for its name field.

so I suggest that when some field is empty, this tag library does not call the corresponding setter method..


Please anyone can help me to do this, and please explain me how this tag is internally worked....

jsp:setProperty does not set the value in the bean, it rather sets a bean as a variable that can be accessed from scriptlet code on the JSP.

Completely deprecated with the introduction of JSTL and now JSF.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.