在我的 JSP 文件中,有一个向 Restlet 服务器发送“POST”请求的表单。然后,Restlet Server 将返回一个 JsonRepresentation,如何获取 Json 并在我的 JSP 中显示 Json。像这样?但似乎不起作用,为什么?
<div>
<form id="simpleForm" method="post" enctype="multipart/form-data">
<input type="text" name="zi"></input>
<input type="file" class="file" name="tupian"></input>
<input type="submit" value="query"></input>
</form>
</div>
<script>
$("#simpleForm").submit(function(event) {
alert("success");
event.preventDefault();//next, I want to post the form on the up to the Reselet Server and deal with the result come from the server,but the server does not work
$.post("http://127.0.0.1:9192/CalligraphyWordService",$("#simpleForm").serialize(),function(data) {
.......
});
});
</script>