List on how to use the Struts tag output value for MAP

xiaoxiao2021-03-05  21

Recently in a project, you have to output a list on the client, and each value in the list is not bean, but Map, I want to have a long time, I think a means, I can realize, the code is as follows

ArrayList Testlist (); havehmap testmap1 = new hashmap (); testmap1.put ("grade", "seventh grade"); testmap1.put ("Class", "one class"); testmap1.put ("Master "," Zhang San "); TestList.Add (TestMap1); HashMap Testmap2 = New HashMap (); TestMap2.Put (" Grade "," Eight Session "); TestMap2.Put (" Class "," Two Class ") TestMap2.Put ("Master", "Zhang San"); TestList.Add (TestMap2); HashMap Testmap3 = new hashmap (); TestMap3.Put ("Grade", "9th grade"); testmap3.put ("Class "," Five classes "); testmap3.put (" Master "," Li Si "); TestList.Add (TestMap3);

Master Class grade

Masterclassgrade

There is also a better way, welcome to communicate, first post on Blog, no typography, please forgive me!

转载请注明原文地址:https://www.9cbs.com/read-37043.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.067, SQL: 9