1

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.

1 Answer 1

3

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

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

There is also something called AngularFaces project on github:

https://github.com/stephanrauh/AngularFaces

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-ajax/

Once again - this is not the recommended way.

Sign up to request clarification or add additional context in comments.

1 Comment

Being the author of AngularFaces, I believe AngularFaces can be used as a full-blown JSF framework :). It's a plug-in taking JSF 2.2, PrimeFaces and BootsFaces to a whole new level. But probably who're right, developers working on a green-field project will prefer to use AngularJS natively. BTW, there's a showcase of AngularFaces at angularfaces.net.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.