File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Question about using logic:empty tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Question about using logic:empty tag" Watch "Question about using logic:empty tag" New topic
Author

Question about using logic:empty tag

kobe phenom
Greenhorn

Joined: Aug 24, 2003
Posts: 11
I would like to display a table containing a list of all items related to a particular option. If the selected option does not have any associated items, a message 'No Items Found' should be displayed. I implemented it by checking if the list of items that will be retrieved from a database will return nothing. In this case, I was able to display in my jsp a message informing the user that no items are found and the table containing the list of items otherwise. My problem is that since upon loading, my list does not contain any values since the user has not selected any option, the message is already displayed.

<pre>
<!-- Display table of items based on selected option -->
<logic:notEmpty name="myForm" property="myList">
<tiles:insert page="myListTiles.jsp" flush="true">
</tiles:insert>
</logic:notEmpty>

<!-- Display message if no items are associated with the option >
<logic:empty name="myForm" property="myList">
<A>No Items</A>
</logic:empty>
</pre>

Can anyone help me how I can resolve this? Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about using logic:empty tag
 
Similar Threads
Break out of a logic block using logic tags
logic:empty tag question
Struts 1.1: Help needed with html:select, html:options, html:optionsCollection
display data
Combinig 2 struts properties using AND Operator