0

I have a huge content of data which is stored in a data-structure (TreeMap) in the backend and I need to display that in my UI which should be based on struts2.

Any idea on how to display the content of the Map in the struts2 front end screen?

In backend I will be using a for loop to iterate through each record of the map and need to display it line by line in the front end. I don't think that I can use textarea for this. Whether there is any feature available in struts2 to print it line by line in the front end by reading it from backend. I am totally new to struts and It will be great if I could get any suggestions. Please let me know in case if any clarification is needed.

4

2 回答 2

0

您需要使用迭代器遍历地图并在屏幕上打印值,就像您可以从SO 上的这个问题中找到的那样。

此外,您应该知道 TreeMap 有多大并不重要,因为 JSP 的呈现将发生在服务器端

编辑您只需要将 Map 传递给 JSP。这意味着您只需要将Map 的gettersetter放入Action 类中。在 JSP 中,您将使用<s:iterate value="myTreeMap">我在上面的链接中看到的标记。

于 2013-10-01T20:41:10.497 回答
0

可以有不同的解决方案来在前端 => 表、li、div、输入等等上显示数据。而且在 jsp 中,你需要一个循环来遍历元素,看看:

于 2013-10-01T20:42:30.883 回答