How to set bean value to empty or null if the property is not provided?
Shannon Sims
Ranch Hand
Joined: Jul 03, 2003
Posts: 187
posted
0
Hello,
Thanks for reviewing my post. I've created a bean using a value from the system properties. If the system property value is not provided, I would like to handle that in the Java code. Is it possible to do this?
Hi Mark,
Sorry about the delay in responding. Thanks for responding to my post and your solution. Yes, your solution would definitely work if I didn't have a typo in my post...I was actually looking to see if I omit the key/value from the system properties, if I could have the bean check for a null key/value pair before setting the bean property value. I couldn't get the app to run without the key, so to work around this, I'm setting the key to an empty string. If you have another solution, I would appreciate it.