Class HttpRequestDispatcher

All Implemented Interfaces:

public class HttpRequestDispatcher extends Object implements RequestDispatcher
This RequestDispatcher dispatches a Request to an HttpRequestProcessorServlet via HTTP. Failover and loadbalancing are not supported in this class, as opposed to the RmiRequestDispatcher. The reason for this is that failover and loadbalancing are typically done in another layer of the HTTP stack, which does not apply to RMI.

This class uses Apache HTTPClient to make the connection to the HttpRequestProcessorServlet. It uses the default functionality of Apache HTTPClient to do its work. If you want to use more advanced functionality of Apache HTTPClient to make the connection, then it should be fairly straightforward to extend this class or implement your own RequestDispatcher implementation with this class as an example.

G.J. Schouten
  • Field Details

  • Constructor Details

    • HttpRequestDispatcher

      public HttpRequestDispatcher()
      Whenever you use this constructor, be sure to set the url with the setter provided by this class. If you don't, runtime exceptions will occur.
    • HttpRequestDispatcher

      public HttpRequestDispatcher(String url)
      Creates an HttpRequestDispatcher that will send the Requests to the specified URL. An HttpRequestProcessorServlet is expected to be listening at this URL. The URL is a standard HTTP URL, such as "http://host:port/path". It can also be an HTTPS URL, beginning with 'https:'. This constructor is recommended, since it forces you to specify the url. Passing a null value for this will result in runtime exceptions whenever the HttpRequestDispatcher is used.
      url -
  • Method Details