与EJB AngularJS应用程序只 [英] AngularJS application with EJB only

查看:272
本文介绍了与EJB AngularJS应用程序只的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能只EJB直接与构建AngularJS应用程序,而无需将它们暴露为REST服务?我看到的在网络上的例子是,你到底有没有使用REST服务提供数据到AngularJS。因此,你会暴露你的EJB方法作为RESTful服务才能够使它们与AngularJS工作。有没有这样做的方法吗?请建议,如果任何提供一些帮助资源。我们正在使用EJB 3.1和IBM WAS 8.5。

Is it possible to build AngularJS application with only EJB directly without having to expose them as REST services? What I have seen on examples on the web is that in the end you have to use REST services to supply data to AngularJS. Hence you would have to expose your EJB methods as RESTful services to be able to make them work with AngularJS. Is there a way without doing this? Please suggest and provide some help resources if any. We are using EJB 3.1 and IBM WAS 8.5.

推荐答案

首先,你必须能够访问你的EJB方法的接口。

First, you must have an interface to access your EJB methods.

如果你开始一个新的项目,我会强烈建议的使用REST 的WebSocket 的办法。进一步阅读使用的WebSockets与AngularJS(虽然Wildfly)可以在这里找到:
http://mgreau.com/posts/2013/11 /11/javaee7-websocket-angularjs-wildfly.html

If you're starting a new project I'd highly recommend using REST or WebSocket approach. Further reading on using WebSockets with AngularJS (although with Wildfly) can be found here: http://mgreau.com/posts/2013/11/11/javaee7-websocket-angularjs-wildfly.html

还有一些所谓的 AngularFaces 在GitHub上的项目:

There is also something called AngularFaces project on github:

https://github.com/stephanrauh/AngularFaces

这需要JSF除了EJB。如果您拒绝使用REST我假设你熟悉JSF框架这是EJB的补充,因为它们都来自的Java EE堆栈。但要小心,因为这种生物的作者强调,这只是为Java EE开发谁也不愿意学习AngularJS或我觉得对传统项目。
下面是更多的是:

It requires JSF besides EJB. If you deny using REST I assume you're familiar with JSF framework which is complementary to EJB as they both come from Java EE stack. But be careful, as the author of this creature emphasizes that it's only for Java EE developers who are reluctant to learn AngularJS or I think for legacy projects. Here is more on that:

http://www.beyondjava.net/blog/angularfaces-jsf -BEYOND阿贾克斯/

再一次 - 这是不推荐的方法

Once again - this is not the recommended way.

这篇关于与EJB AngularJS应用程序只的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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