Problem with a null string in java
Hello,
I have a JTable wholesale string and I, when the user presses a button, I store all the values that are in my JTable, unless there is nothing in my JTable. For that I do a test on every box and I test if the contents of my box is null. The problem is that if the user enters something in a box, then delete it (thus its contents are empty again) when I do my test, it can not see the contents of this box as being null. How can I do it? Any help is appreciated. Thank you for your help in advance.
Re: Problem with a null string in java
Even I am interested in this discussion because I am searching for the same, how to say that the length of the string is null?
Code:
I also tried test !="";
but even this is not working. Is there any different method for this to do? thank you
Re: Problem with a null string in java
A few months before I had the same issue but now I have a solution for now. I compares the sting in this way
Code:
teststr.length ()! = 0
This is the way how you have to do it. I hope this will help you
Re: Problem with a null string in java
Hello,
I like to know how to check a string is not null or empty in Struts?
Here is the code
Code:
<S: set name ="temp" value ="hr.picturePath"/> <s:if test ="temp" = ""> <img src ="<s: property value ="hr.PicturePath"/> "> </ s: if>
I tried a lot of solutions found on the net but nothing works. However, my image appears even if I did not integrate into it. Do you have a solution?
Re: Problem with a null string in java
Well after numerous attempts I finally reached a conclusive result
Code:
<S: set name ="temp" value ="hr.picturePath"/> <s:if test ="% (# temp! = null)"> <img src ="<s: property value ="temp"/ > "> </ s: if>