Object ArrayListにはいくつかの変数があり、ObjectのArrayListに格納しています。私はそれをJSONArrayに変換してJSPページに渡します。javascriptでArrayListにアクセスする方法<Object>をJSONArrayに変換しました
<textarea rows="10" cols="50" id="display"></textarea>
<script>
function fileList(){
<% JSONArray fileList;
if(request.getAttribute("fileList") != null){
fileList = (JSONArray) request.getAttribute("fileList");
%>
<% } %>
}
</script>
:私はここで私はテキストエリアを作成する必要があり、私のJSPページ内の私のJavaのコントローラー、
ArrayList<myObject> filesContainer = //from source file
JSONArray jsFileList = new JSONArray(fileSources);
ModelAndView mnv = new ModelAndView();
mnv.addObject("fileList", jsFileList);
mnv.setViewName("forward:Test.jsp");
return mnv;
でJavaScript
public class myObject{
private String fileName;
private String filePath;
private List<String> messsage;
//Constructor, null constructor and access modifier methods.
}
を使用してJSPページ上のテキストエリアでこれらのオブジェクトをどのように表示されません
jspファイルのfileName、filePathにアクセスするにはどうすればよいですか?