This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes JSF and the fly likes Sending a request and a response From a Managed Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Sending a request and a response From a Managed Bean" Watch "Sending a request and a response From a Managed Bean" New topic
Author

Sending a request and a response From a Managed Bean

Ayaan Dar
Greenhorn

Joined: Oct 27, 2010
Posts: 10
Hi,

I have a Managed Bean that needs to send a request to a Servlet deployed on a Separate Server and read the response from it . How can i do this?

Kind Regards.

Maroun Baydoun
Greenhorn

Joined: Sep 23, 2011
Posts: 4

I am not sure you can invoke a remote server the way you're intending. A workaround would be to use a URLConnection that will send a request to the servlet and will enable you to get some form of feedback

For example:

Ayaan Dar
Greenhorn

Joined: Oct 27, 2010
Posts: 10
This is exactly the way i did it. Here is the complete code for anyone who wants its
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Sending a request and a response From a Managed Bean