You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by eugenebalt <eu...@yahoo.com> on 2012/03/20 19:12:58 UTC

How to set HTTP Header "Content-Length" in IResourceListener?

As I wrote in other messages, I have a custom widget that implements
IResourceListener.

I override onResourceRequested(). When rendering the resource I need to set
the ContentLength of the response that sends the binary data to the client.
Where is the best place to do it? I have access to
getRequestCycle().getResponse(), but that gives me a Response. I need a
WebResponse.

Do I need to set it in onResourceRequested()? Thanks

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-set-HTTP-Header-Content-Length-in-IResourceListener-tp4489832p4489832.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: How to set HTTP Header "Content-Length" in IResourceListener?

Posted by Martijn Dashorst <ma...@gmail.com>.
Response is there to provide an abstraction for e.g. portlets, and
other types of requests. As long as you are working in a web container
and don't install or use extensions (that I am unaware of exist),
casting is fine.

Martijn

On Wed, Mar 21, 2012 at 9:56 AM, Martin Grigorov <mg...@apache.org> wrote:
> On Tue, Mar 20, 2012 at 8:12 PM, eugenebalt <eu...@yahoo.com> wrote:
>> As I wrote in other messages, I have a custom widget that implements
>> IResourceListener.
>>
>> I override onResourceRequested(). When rendering the resource I need to set
>> the ContentLength of the response that sends the binary data to the client.
>> Where is the best place to do it? I have access to
>> getRequestCycle().getResponse(), but that gives me a Response. I need a
>> WebResponse.
>
> Just cast it
>
>>
>> Do I need to set it in onResourceRequested()? Thanks
>>
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-set-HTTP-Header-Content-Length-in-IResourceListener-tp4489832p4489832.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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


Re: How to set HTTP Header "Content-Length" in IResourceListener?

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Mar 20, 2012 at 8:12 PM, eugenebalt <eu...@yahoo.com> wrote:
> As I wrote in other messages, I have a custom widget that implements
> IResourceListener.
>
> I override onResourceRequested(). When rendering the resource I need to set
> the ContentLength of the response that sends the binary data to the client.
> Where is the best place to do it? I have access to
> getRequestCycle().getResponse(), but that gives me a Response. I need a
> WebResponse.

Just cast it

>
> Do I need to set it in onResourceRequested()? Thanks
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-set-HTTP-Header-Content-Length-in-IResourceListener-tp4489832p4489832.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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