0

Can a Java EE Application -- a Servlet or a Session Bean -- make HTTP calls and still conform to portability standards? (assuming that the caller gracefully handles communication failure or unavailability of network)

Furthermore, can a Java EE 7 application count on availability of JAX-RS client to access REST-like resources?

necromancer
  • 21,492
  • 19
  • 65
  • 111

1 Answers1

2
  1. You can make HTTP calls from Servlet or Session Bean (as long as you are not trying to do that in a separate thread). In general, you can open client socket in EJB Bean or Servlet.

  2. JAX-RS 2.0, which is a part of Java EE 7 has client API (see this excelent article: http://www.oracle.com/technetwork/articles/java/jaxrs20-1929352.html)

Piotr Kochański
  • 19,970
  • 6
  • 67
  • 75
  • thanks for the great answer. i had a related question on how to do large-scale long-polling from the client-side. i. e. instead of serving a large number of open, mostly idle connections, you are requesting a large number of open, mostly idle connections. what framework/library/technique is the client-side analog of servlet 3 async. i will post it as a separate question but wanted to throw it out. thank you! – necromancer May 09 '13 at 19:55