Results 1 to 9 of 9
  1. #1
    vector_ever is online now Senior Member
    Join Date
    Jul 2013
    Posts
    183
    Rep Power
    2

    Default Display attribute if not null

    Hello,

    i want to call attribute from database and display them, some of these data are empty (null).
    when i display it i got empty line...
    So i add condition, if the value of the attribute is null, don't display it

    Java Code:
                    <ui:repeat var="mit" value="#{mitarbeiter.mitarbList}" varStatus="status">
                        <ul>
                            <li>
                                #{mit.title} #{mit.name} #{mit.lastName}<br></br>
                                <c:if test="#{not empty mit.telephone}">
                                Telephone: #{mit.telephone}<br></br>
                                </c:if>
                                Email: #{mit.email}<br></br>
                                <c:if test="#{not empty mit.beaschaeftigungsDauer}">
                                Time: #{mit.beaschaeftigungsDauer}<br></br>
                                </c:if>
                            </li>
    
                        </ul>
                    </ui:repeat>
    but is doesn’t work, it always doesn’t display the the attribute whatever the value empty or not...

    So what is the wrong?

    What should i change in this code

    Java Code:
    <c:if test="#{not empty mit.telephone}">
                Telephone: #{mit.telephone}<br></br>
                </c:if>

  2. #2
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,691
    Rep Power
    5

    Default Re: Display attribute if not null

    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    vector_ever is online now Senior Member
    Join Date
    Jul 2013
    Posts
    183
    Rep Power
    2

    Default Re: Display attribute if not null

    I don't get the answer of my question

  4. #4
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,691
    Rep Power
    5

    Default Re: Display attribute if not null

    That's too bad.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    vector_ever is online now Senior Member
    Join Date
    Jul 2013
    Posts
    183
    Rep Power
    2

    Default Re: Display attribute if not null

    !!!
    Maybe i will be better if you try help me than saying some complement!!

  6. #6
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,691
    Rep Power
    5

    Default Re: Display attribute if not null

    I can't help someone like you, I'm just not patient enough.

    But I do hope that others who find your question through Google are helped by the link. Or at least have the common sense to do further reading into the subject in stead of just blabbing "it doesn't help".
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    vector_ever is online now Senior Member
    Join Date
    Jul 2013
    Posts
    183
    Rep Power
    2

    Default Re: Display attribute if not null

    When i wrote "it didn't help" i meant it exactly, i tried the solution suggestions in your link, but it made no difference... It another type from problems...

    Anyway, if you don't want to help, you can do what you want, but with respect..

  8. #8
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,691
    Rep Power
    5

    Default Re: Display attribute if not null

    But because you assume people have a crystal ball and can see what you have been doing instead of providing actual information, you are impossible to be helped. I refuse to spend ages trying to pull any kind of information out of you so you might position yourself in a way that you CAN be helped. You remain on my ignore shitlist until you realize that.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  9. #9
    vector_ever is online now Senior Member
    Join Date
    Jul 2013
    Posts
    183
    Rep Power
    2

    Default Re: Display attribute if not null

    Oh no no please not in your black list nooooo, how can i live without your precious help...
    Really very funny.
    I am glad that you are out of my way...i don't need any help from some one like you
    Next time if you saw any post please don't disturb me, you tough boy...very funny

Similar Threads

  1. Replies: 6
    Last Post: 10-18-2010, 10:40 AM
  2. how to read an attribute of an xml tag in jsp.
    By himacherla in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 07-21-2009, 06:27 AM
  3. how to add an attribute with sax?
    By cecily in forum New To Java
    Replies: 3
    Last Post: 07-19-2007, 04:09 AM
  4. Problem with Attribute in JSP
    By Albert in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-13-2007, 03:11 PM
  5. Request attribute PageBean = null
    By Nick15 in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 05-17-2007, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •