Question

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?

Était-ce utile?

La solution

  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)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top