You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Swinsburg <s....@lancaster.ac.uk> on 2009/02/05 13:45:22 UTC
making a HTTP request directly in Wicket
Hi all,
just wondering if there is any API in Wicket that wraps up making a
HTTP POST request directly (ie given a URL and some data etc) or
whether I should just drop back to using the standard Java HTTPClient
stuff?
cheers,
Steve
Re: making a HTTP request directly in Wicket
Posted by Stephen Swinsburg <s....@lancaster.ac.uk>.
Yeah I meant 'timeout' as in waiting for a process to run and the web
server timing out. I will still set a timeout on the thread though.
On 07/02/2009, at 1:58 AM, Marcelo Morales wrote:
> It can connect and stall forever. People restart firewalls you know. I
> must insist on using at least setReadTimeout(int).
>
> On Fri, Feb 6, 2009 at 3:15 AM, Swinsburg, Stephen
> <s....@lancaster.ac.uk> wrote:
>> I was just going to do it in a different thread, make a void
>> function then it can take as long as it needs without having
>> timeouts. Might still have a timeout just in case though ;)
>>
>> cheers.
>>
>>
>>
>> -----Original Message-----
>> From: Erik van Oosten [mailto:e.vanoosten@grons.nl]
>> Sent: Fri 2/6/2009 5:40 AM
>> To: users@wicket.apache.org
>> Subject: Re: making a HTTP request directly in Wicket
>>
>> Thanks Peter, Marcelo,
>>
>> Still learning every day...
>>
>> Regards,
>> Erik.
>>
>> Marcelo Morales wrote:
>>> Don't forget setReadTimeout(int)
>>> Also very important.
>>>
>>> On Thu, Feb 5, 2009 at 11:42 AM, Peter Ertl <pe...@gmx.org> wrote:
>>>
>>>>> Please use commons HttpClient, with the standard Java client you
>>>>> have no
>>>>> control over timeouts potentially hanging your application.
>>>>>
>>>> Is this still true?
>>>>
>>>> I found that at least in Java 6 there is
>>>>
>>>> URLConnection.setConnectTimeout(int)
>>>>
>>
>>
>> --
>> Erik van Oosten
>> http://www.day-to-day-stuff.blogspot.com/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> Marcelo Morales
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making a HTTP request directly in Wicket
Posted by Peter Ertl <pe...@gmx.org>.
setReadTimeout() exists since java 1.5 so I guess the right
recommendation would be to use HttpClient if you are still bound to 1.4
Am 07.02.2009 um 02:58 schrieb Marcelo Morales:
> It can connect and stall forever. People restart firewalls you know. I
> must insist on using at least setReadTimeout(int).
>
> On Fri, Feb 6, 2009 at 3:15 AM, Swinsburg, Stephen
> <s....@lancaster.ac.uk> wrote:
>> I was just going to do it in a different thread, make a void
>> function then it can take as long as it needs without having
>> timeouts. Might still have a timeout just in case though ;)
>>
>> cheers.
>>
>>
>>
>> -----Original Message-----
>> From: Erik van Oosten [mailto:e.vanoosten@grons.nl]
>> Sent: Fri 2/6/2009 5:40 AM
>> To: users@wicket.apache.org
>> Subject: Re: making a HTTP request directly in Wicket
>>
>> Thanks Peter, Marcelo,
>>
>> Still learning every day...
>>
>> Regards,
>> Erik.
>>
>> Marcelo Morales wrote:
>>> Don't forget setReadTimeout(int)
>>> Also very important.
>>>
>>> On Thu, Feb 5, 2009 at 11:42 AM, Peter Ertl <pe...@gmx.org> wrote:
>>>
>>>>> Please use commons HttpClient, with the standard Java client you
>>>>> have no
>>>>> control over timeouts potentially hanging your application.
>>>>>
>>>> Is this still true?
>>>>
>>>> I found that at least in Java 6 there is
>>>>
>>>> URLConnection.setConnectTimeout(int)
>>>>
>>
>>
>> --
>> Erik van Oosten
>> http://www.day-to-day-stuff.blogspot.com/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> Marcelo Morales
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making a HTTP request directly in Wicket
Posted by Marcelo Morales <ma...@gmail.com>.
It can connect and stall forever. People restart firewalls you know. I
must insist on using at least setReadTimeout(int).
On Fri, Feb 6, 2009 at 3:15 AM, Swinsburg, Stephen
<s....@lancaster.ac.uk> wrote:
> I was just going to do it in a different thread, make a void function then it can take as long as it needs without having timeouts. Might still have a timeout just in case though ;)
>
> cheers.
>
>
>
> -----Original Message-----
> From: Erik van Oosten [mailto:e.vanoosten@grons.nl]
> Sent: Fri 2/6/2009 5:40 AM
> To: users@wicket.apache.org
> Subject: Re: making a HTTP request directly in Wicket
>
> Thanks Peter, Marcelo,
>
> Still learning every day...
>
> Regards,
> Erik.
>
> Marcelo Morales wrote:
>> Don't forget setReadTimeout(int)
>> Also very important.
>>
>> On Thu, Feb 5, 2009 at 11:42 AM, Peter Ertl <pe...@gmx.org> wrote:
>>
>>>> Please use commons HttpClient, with the standard Java client you have no
>>>> control over timeouts potentially hanging your application.
>>>>
>>> Is this still true?
>>>
>>> I found that at least in Java 6 there is
>>>
>>> URLConnection.setConnectTimeout(int)
>>>
>
>
> --
> Erik van Oosten
> http://www.day-to-day-stuff.blogspot.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Marcelo Morales
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: making a HTTP request directly in Wicket
Posted by "Swinsburg, Stephen" <s....@lancaster.ac.uk>.
I was just going to do it in a different thread, make a void function then it can take as long as it needs without having timeouts. Might still have a timeout just in case though ;)
cheers.
-----Original Message-----
From: Erik van Oosten [mailto:e.vanoosten@grons.nl]
Sent: Fri 2/6/2009 5:40 AM
To: users@wicket.apache.org
Subject: Re: making a HTTP request directly in Wicket
Thanks Peter, Marcelo,
Still learning every day...
Regards,
Erik.
Marcelo Morales wrote:
> Don't forget setReadTimeout(int)
> Also very important.
>
> On Thu, Feb 5, 2009 at 11:42 AM, Peter Ertl <pe...@gmx.org> wrote:
>
>>> Please use commons HttpClient, with the standard Java client you have no
>>> control over timeouts potentially hanging your application.
>>>
>> Is this still true?
>>
>> I found that at least in Java 6 there is
>>
>> URLConnection.setConnectTimeout(int)
>>
--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making a HTTP request directly in Wicket
Posted by Erik van Oosten <e....@grons.nl>.
Thanks Peter, Marcelo,
Still learning every day...
Regards,
Erik.
Marcelo Morales wrote:
> Don't forget setReadTimeout(int)
> Also very important.
>
> On Thu, Feb 5, 2009 at 11:42 AM, Peter Ertl <pe...@gmx.org> wrote:
>
>>> Please use commons HttpClient, with the standard Java client you have no
>>> control over timeouts potentially hanging your application.
>>>
>> Is this still true?
>>
>> I found that at least in Java 6 there is
>>
>> URLConnection.setConnectTimeout(int)
>>
--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making a HTTP request directly in Wicket
Posted by Marcelo Morales <ma...@gmail.com>.
Don't forget setReadTimeout(int)
Also very important.
On Thu, Feb 5, 2009 at 11:42 AM, Peter Ertl <pe...@gmx.org> wrote:
>> Please use commons HttpClient, with the standard Java client you have no
>> control over timeouts potentially hanging your application.
>
> Is this still true?
>
> I found that at least in Java 6 there is
>
> URLConnection.setConnectTimeout(int)
>
>
> Cheers
> Peter
>
>
> Am 05.02.2009 um 14:12 schrieb Erik van Oosten:
>
>>
>> Its probably not there; Wicket is a server side framework after all.
>>
>> Please use commons HttpClient, with the standard Java client you have no
>> control over timeouts potentially hanging your application.
>>
>> Regards,
>> Erik.
>>
>>
>> Steve Swinsburg wrote:
>>>
>>> Hi all,
>>>
>>> just wondering if there is any API in Wicket that wraps up making a HTTP
>>> POST request directly (ie given a URL and some data etc) or whether I should
>>> just drop back to using the standard Java HTTPClient stuff?
>>>
>>> cheers,
>>> Steve
>>
>> --
>>
>> Erik van Oosten
>> http://day-to-day-stuff.blogspot.com/
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Marcelo Morales
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making a HTTP request directly in Wicket
Posted by Peter Ertl <pe...@gmx.org>.
> Please use commons HttpClient, with the standard Java client you
have no control over timeouts potentially hanging your application.
Is this still true?
I found that at least in Java 6 there is
URLConnection.setConnectTimeout(int)
Cheers
Peter
Am 05.02.2009 um 14:12 schrieb Erik van Oosten:
>
> Its probably not there; Wicket is a server side framework after all.
>
> Please use commons HttpClient, with the standard Java client you
> have no control over timeouts potentially hanging your application.
>
> Regards,
> Erik.
>
>
> Steve Swinsburg wrote:
>> Hi all,
>>
>> just wondering if there is any API in Wicket that wraps up making a
>> HTTP POST request directly (ie given a URL and some data etc) or
>> whether I should just drop back to using the standard Java
>> HTTPClient stuff?
>>
>> cheers,
>> Steve
>
> --
>
> Erik van Oosten
> http://day-to-day-stuff.blogspot.com/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making a HTTP request directly in Wicket
Posted by Erik van Oosten <e....@grons.nl>.
Its probably not there; Wicket is a server side framework after all.
Please use commons HttpClient, with the standard Java client you have no
control over timeouts potentially hanging your application.
Regards,
Erik.
Steve Swinsburg wrote:
> Hi all,
>
> just wondering if there is any API in Wicket that wraps up making a
> HTTP POST request directly (ie given a URL and some data etc) or
> whether I should just drop back to using the standard Java HTTPClient
> stuff?
>
> cheers,
> Steve
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making a HTTP request directly in Wicket
Posted by Steve Swinsburg <s....@lancaster.ac.uk>.
Thanks all. need POST so will use httpclient (need to make another
request to an external service after a form is submitted)
cheers,
Steve
On 5 Feb 2009, at 13:15, Martin Makundi wrote:
> There is QueryStringUrlCodingStrategy if that is what you mean... if
> you just want to construct a query url (GET).
>
> In my understanding POST must come from the client browser so it
> cannot be constructed by Wicket as such.
>
> **
> Martin
>
> 2009/2/5 Steve Swinsburg <s....@lancaster.ac.uk>:
>> Hi all,
>>
>> just wondering if there is any API in Wicket that wraps up making a
>> HTTP
>> POST request directly (ie given a URL and some data etc) or whether
>> I should
>> just drop back to using the standard Java HTTPClient stuff?
>>
>>
>>
>> cheers,
>> Steve
>>
>>
>>
>>
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
Re: making a HTTP request directly in Wicket
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
There is QueryStringUrlCodingStrategy if that is what you mean... if
you just want to construct a query url (GET).
In my understanding POST must come from the client browser so it
cannot be constructed by Wicket as such.
**
Martin
2009/2/5 Steve Swinsburg <s....@lancaster.ac.uk>:
> Hi all,
>
> just wondering if there is any API in Wicket that wraps up making a HTTP
> POST request directly (ie given a URL and some data etc) or whether I should
> just drop back to using the standard Java HTTPClient stuff?
>
>
>
> cheers,
> Steve
>
>
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making a HTTP request directly in Wicket
Posted by Ryan Gravener <ry...@ryangravener.com>.
I would use:
http://hc.apache.org/httpclient-3.x/
Ryan Gravener
http://ryangravener.com/flex | http://twitter.com/ryangravener
On Thu, Feb 5, 2009 at 7:45 AM, Steve Swinsburg <s.swinsburg@lancaster.ac.uk
> wrote:
> Hi all,
>
> just wondering if there is any API in Wicket that wraps up making a HTTP
> POST request directly (ie given a URL and some data etc) or whether I should
> just drop back to using the standard Java HTTPClient stuff?
>
>
>
> cheers,
> Steve
>
>
>
>
>
>
>
>