我如何调用一个JSF动作方法,使用Ajax(在JSF 1.2)? [英] how do i call a jsf action method (in JSF 1.2) using Ajax?

查看:112
本文介绍了我如何调用一个JSF动作方法,使用Ajax(在JSF 1.2)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写在我的Apache在JSF 1.2应用程序的面孔。我不能使用任何自定义组件库 - 像战斧或A4J等。有没有一种方法来调用JSF中使用Ajax的操作方法?当JSF动作完成后,我想处理通过Javascript的JSF动作的响应并填充在客户端div标签?可能吗?谢谢你。

I am writing a JSF 1.2 Application in Apache My faces. I cannot use any customized component library - like tomahawk or a4j and others. Is there a way to call an action method of JSF using Ajax? When the JSF action is done , I would like to handle the response of the JSF action by Javascript and populate a DIV Tag in the Client side ? Is it possible? Thanks.

推荐答案

JSF 1.2不提供任何内置的AJAX设施。你已经基本上2个选项:

JSF 1.2 does not provide any builtin ajax facilities. You have basically 2 options:

  1. Homegrow的ajaxical组件库。既然你已经采取了JSF生命周期和组件树考虑在处理ajaxical请求这是不那么容易。这也将最终采取更多的时间比使用现有的ajaxical组件库。

  1. Homegrow an ajaxical component library. It isn't that easy since you've to take the JSF lifecycle and component tree into account while handling ajaxical requests. It would also end up to take much more time than using an existing ajaxical component library.

使用现有ajaxical组件库。最简单的是的Ajax4jsf (纯AJAX标签,无UI组件,它很像< F:AJAX> 在JSF 2.0)。这是RichFaces的组成部分,但你也可以单独下载并安装它,而不需要它周围的整个RichFaces的组件库。这将是我的建议。你可以找到开发者文档这里并下载库 rel="nofollow">。

Use an existing ajaxical component library. The simplest one would be Ajax4jsf (pure ajax tags, no UI components, it's much like <f:ajax> in JSF 2.0). This is part of RichFaces, but you can also download and install it separately without the need for the whole RichFaces component library around it. This would be my recommendation. You can find the developer documentation here and download the library here.

这篇关于我如何调用一个JSF动作方法,使用Ajax(在JSF 1.2)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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