我迫切需要在jsf中使用以下动态字符串数据创建dataTable。我尽可能地走了,我迫切需要帮助。我想要做的是遍历数据以显示在我的dataTable上。
以下是我走了多远
enter code here
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
*
* @author mySelf
*/
public class One {
static String s = "1701|001271651913|e13f7108-6f7c-4ea5-b77f-f016259a574e, "
+ "1701|001207488366|2ee40509-af86-4470-84c8-0d2aec494367";
public static List<String> myGuava() {
List<String> ss = new ArrayList<>(Arrays.asList(s.split(",")));
List<String> oldList = new ArrayList<>(ss);
Iterator<String> iterator = oldList.iterator();
List myList = new ArrayList();
while (iterator.hasNext()) {
ArrayList as = new ArrayList();
as.add(iterator.next().replace("|", ",").trim());
Collections.addAll(myList, as);
}
return myList;
}
public static void main(String[] args) {
List<String> myGuava = One.myGuava();
System.out.println(myGuava);
}
}
任何有助于我在jsf dataTable上显示此内容的帮助都将非常受重视。
提前致谢。
答案 0 :(得分:0)