你好,我是liferay
世界的新人。
我有一个表单,通过ajax请求将emailaddress传递给我serveResource
的{{1}}方法。
在该电子邮件地址的基础上,我必须搜索portlet
数据库中的相应用户,并将User对象作为响应传递回我的JSP页面。我怎么做?
如何将对象作为响应传递,从liferay
方法到JSP页面?
帮助我。
答案 0 :(得分:1)
使用像writeJSON(resourceRequest, resourceResponse, json);
这样的方法
请参阅liferay源代码中的完整示例:https://github.com/amusarra/liferay-aui-autocomplete-ajax-example/blob/master/src/main/java/it/dontesta/liferay/portlet/ViewAUIAutocompleteAjax.java