4

I want to remove the message Nothing Found to Display in Struts 1.3 Display Tag , When no record fetch from database.

Its possible to do this...?

lschin
  • 6,745
  • 2
  • 38
  • 52
abhu74
  • 53
  • 2
  • 6

4 Answers4

7

From my point of view the default behavior should be that no message must be displayed in case of empty data source.

The empty_list didn't work in my case. I tried this and it works:

<display:table ...
   <display:setProperty name="basic.msg.empty_list" value="" />

   <display:column ...
   ...
</display:table>

You can also customize you message in html format:

<display:setProperty name="basic.msg.empty_list" 
    value="<span style=\"font-size:12px\">No data</span>" />

I hope it will help...

Augusto
  • 96
  • 1
2

You can set a configuration property for the display table. See here for more details.

The configuration property to set is basic.msg.empty_list_row which by default has the "Nothing found to display." value. See this other page for more details.

So your code will look something like this:

<display:table ... >
   <display:setProperty name="basic.msg.empty_list_row"> 
      ... insert your choise here ... 
   </display:setProperty>
   ...
</display:table>
0

remove "pagesize" attribute, it fixes the issue for struts2 & Displaytag 1.2 (that annoying message is called PageBanner"

yasin
  • 270
  • 4
  • 6
-2

Add the following entry to "displaytag.properties" file and place the file in Class Path -

basic.msg.empty_list=

Also you can set any message here -

basic.msg.empty_list=No matching entries found !!!

nsgulliver
  • 12,655
  • 23
  • 43
  • 64