|
-
September 9th, 2010, 05:18 AM
#1
Checking an empty or null string(Request)
if (!("".equals(req_.getNonEmpData())) ||!(req_.getNonEmpData().equals(null)) )
{
itemsNonEmp= req_.getNonEmpData().split(",");
}
if ((req_.getEmpData() != null) && (!req_.getEmpData().equals("")))
{
itemsEmp=req_.getEmpData().split(",");
}
I have checked with every possible scenario for checking null or empty.
But even if the value of req_.getNonEmpData()=null,its entering the block and trying to split the empty variable..Hence Null pointer exception is being thrown...At the time of debugging,I have hardcoded the value of req_.getNonEmpData() to null,then also its entering in the block.
Any suggestion ,How to check for empty or null value in req_.getNonEmpData()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|