0
我需要知道如何將矢量轉換爲字符串並將字符串拆分爲JSP。將矢量轉換爲字符串並拆分爲JSP的字符串
// Make sure that you use the same path/filename that you’ve saved earlier
Vector<String[]> vec1 = FileReaderWriter.readFileToVector ("?/MyTestFile.txt");
String vec2 = vec1.toString();
String split[] = vec2.split(",");
for (int i = 0; i < vec1.size(); i++)
{
// out.print("|");
for (int j = 0; j < vec1.elementAt(i).length; j++)
{
// out.print(vec1.elementAt(i)[j] + ",");
//out.print("blah");
// fieldlist.add(vec1.elementAt(i)[j]);
out.print("<br/>");
}
//out.print("blah");
問題是輸出是亂碼,它不是打印向量中的內容。相反,爲什麼使用<c:foreach>
不遍歷列表中的JSP轉化載體,以字符串和分裂它的
感謝