Results 1 to 5 of 5

Thread: Problem with a null string in java

  1. #1
    Join Date
    Mar 2010
    Posts
    303

    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.

  2. #2
    Join Date
    Mar 2010
    Posts
    330

    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

  3. #3
    Join Date
    Dec 2009
    Posts
    192

    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

  4. #4
    Join Date
    Mar 2010
    Posts
    372

    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?

  5. #5
    Join Date
    Sep 2009
    Posts
    143

    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>

Similar Threads

  1. Replies: 2
    Last Post: 15-02-2012, 05:52 PM
  2. Null pointer error in java
    By Elizabeth Allen in forum Software Development
    Replies: 5
    Last Post: 19-03-2010, 02:26 PM
  3. In Java Script how to Check Null Value?
    By taher in forum Software Development
    Replies: 5
    Last Post: 04-02-2010, 03:18 AM
  4. How to check java string not null or blank
    By Capper in forum Software Development
    Replies: 4
    Last Post: 30-07-2009, 07:11 PM
  5. SQL need to check null or empty string
    By B_Hodge in forum Software Development
    Replies: 3
    Last Post: 18-06-2009, 11:44 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,356,512.30267 seconds with 16 queries