呼叫JSF动作直通jQuery的阿贾克斯 [英] Call JSF action thru jQuery ajax

查看:149
本文介绍了呼叫JSF动作直通jQuery的阿贾克斯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何调用JSF动作方法直通jQuery的AJAX?

How to call a JSF action method thru jQuery AJAX?

推荐答案

直接通过AJAX调用JSF的观点是不明智的,除非你的JSF堆栈支持AJAX,你知道如何构建请求以这样的方式堆栈理解。这里的错误可能会导致问题的视图状态和难以诊断的错误。

Calling a JSF view directly through AJAX is unwise unless your JSF stack supports AJAX and you know how to construct the request in such a way that the stack understands. Mistakes here can result in problems with the view state and difficult to diagnose errors.

核心JSF 1.2(之前)没​​有直接的AJAX支持; 提供不同程度的支持AJAX的第三方框架。 JSF 2 增加了AJAX的JavaScript库的核心框架(的大卫·吉尔里演示),因此使用,如果可能的。

Core JSF 1.2 (and before) does not have direct AJAX support; 3rd party frameworks provide varying degrees of AJAX support. JSF 2 adds AJAX JavaScript libraries to the core framework (David Geary demonstrates), so use that if possible.

一个倒过来,这一切都是用servlet来直接与模型交互(即不是回发到JSP / facelet中查看)。这可能是适当的,这取决于究竟你在做什么。

One way round all this is to use a servlet to interact with the model directly (i.e. not posting back to the JSP/Facelet view). This may be adequate, depending on exactly what you are doing.

这篇关于呼叫JSF动作直通jQuery的阿贾克斯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆