•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 397,810 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,517 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1317 | Replies: 0
![]() |
•
•
Join Date: Sep 2006
Posts: 65
Reputation:
Rep Power: 0
Solved Threads: 0
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..???
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..???
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
- what is wrong with this jsp expression? (JSP)
- Help in JSP Doubt (JSP)
- back end of the "< jsp:setProperty" tag (JSP)
- error due to accessing database connection using jsp (JSP)
- JSP Error (JSP)
- [urgent] JSP problem (JSP)
- Jsp doesnt return parameter value (JSP)
Other Threads in the JSP Forum
- Previous Thread: plz help me.....
- Next Thread: how to show java out puts in web browser


Linear Mode