rpjanaka 0 Junior Poster in Training

Hi all,

I want to use the <jsp:setProperty….> tag. When this is used it says that it calls to the setter methods and set the instance variables that submitted from a web page. (I suggest that it gets the instance fields from JSP request object and assign those).

But in my bean class there is a string field that should never be null. So to control this I tried to check it with in the setter method and assign an empty string if it is null.

public void setOpZone(String opZone) {
if(opZone == null){
opZone = “”;
}
this.opZone = opZone;
}


But still this is not working. The final result will shows the opZone field is null.

Why is this..???