You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by TomSimmons <to...@ge.com> on 2009/07/09 11:02:02 UTC

Using HttpClient with my JSP session

Morning All

I'm hoping someone can help me out here.

I have a JSP running on JBoss, that all works fine.  I need from within that
application to use HttpClient to request a JSP page within the same
application, but so I get the resulting HTML in a string that I can then use
as the body for an HTML Email.

My problem is that I cannot figure out, or find on Google, a clear and
working example on how I make the HttpClient request use the same session as
my JSP is using.

I know it isn't because the session filter checks for certain things on the
session, and redirects to the login page if they're missing.


Thanks

Tom
-- 
View this message in context: http://www.nabble.com/Using-HttpClient-with-my-JSP-session-tp24406615p24406615.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

Re: Using HttpClient with my JSP session

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, Jul 09, 2009 at 02:02:02AM -0700, TomSimmons wrote:
> 
> Morning All
> 
> I'm hoping someone can help me out here.
> 
> I have a JSP running on JBoss, that all works fine.  I need from within that
> application to use HttpClient to request a JSP page within the same
> application, but so I get the resulting HTML in a string that I can then use
> as the body for an HTML Email.
> 
> My problem is that I cannot figure out, or find on Google, a clear and
> working example on how I make the HttpClient request use the same session as
> my JSP is using.
> 
> I know it isn't because the session filter checks for certain things on the
> session, and redirects to the login page if they're missing.
> 
> 
> Thanks
> 
> Tom

Hi Tom,

You need to manually add the session cookie to the cookie store bound to the
execution context and make sure it gets picked up when requests are generated
by setting appropriate domain and path attribute values

http://hc.apache.org/httpcomponents-client/tutorial/html/ch03.html#d4e672

Oleg


> -- 
> View this message in context: http://www.nabble.com/Using-HttpClient-with-my-JSP-session-tp24406615p24406615.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org