我正在尝试通过 ajax 将 JAVA CLASS INSTANCE 从我的 javascript 代码发送到 JSP 文件。我该如何发送?我尝试像这样发送实例:
data = {}
data['my_instance'] = JAVA_CLASS_INSTANCE
并通过 ajax 发送此数据,问题是,在 JSP 中,它作为字符串而不是类接收它
顺便说一句,我得到这样的java类实例:
<script type='text/javascript'>
var class_instance = "<%= my_class_instance %>"; //if this method is wrong, plz tell me correct method to get instance and send via ajax. Already I have a form, along with the form data, i am trying to send this class also. If there is anyother good way for this, just tell me.
</script>