You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Beller, Maximilian" <m....@hpc-hamburg.de> on 2004/05/03 16:40:58 UTC

Using HttpClient for a servlet include

Hi!

I need to include an url from an external server like:

HttpServletRequest request;
request.getRequestDispatcher(externalURL).include(request, response);


As this approach doesn't work for URLs from foreign hosts I looked at
HttpClient to "simulate" something like an include.

I've managed to call my external URL. The action behind it is executing
successfully.

But I need the external action to access my HttpServletRequest(session)
and HttpServletResponse. 

Is HttpClient the correct approach? And how can i manage
HttpServletRequest/HttpServletResponse with HttpClient??

Thank you for any help,
Max

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Re: Using HttpClient for a servlet include

Posted by Ortwin Glück <or...@nose.ch>.

Beller, Maximilian wrote:
> But I need the external action to access my HttpServletRequest(session)
> and HttpServletResponse. 

Those are local objects you can not and should not expose to external 
applications. Please consider the use of web services in conjunction 
with EJBs. Otherwise I fear you will end up in a terrible mess.

Ortwin Glück

-- 
  _________________________________________________________________
  NOSE applied intelligence ag

  ortwin glück                      [www]      http://www.nose.ch
  software engineer                 [email] ortwin.glueck@nose.ch
  hardturmstrasse 171               [pgp id]           0x81CF3416
  8005 zürich                       [office]      +41-1-277 57 35
  switzerland                       [fax]         +41-1-277 57 12

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org