Hi,

I'm familiar with how to do it in my own RawScreen, what I wanted is to
apply it to all turbine generated pages.

So basically, following your example, I'd like to know what would be the
best place to use the result of  "someMethodBuildsMyScreen();" within
Turbine..

Any clues?

Cheers, Bo



                                                                           
             "Jeffery Painter"                                             
             <pain...@kiasoft.                                             
             com>                                                     Para 
                                       "Turbine Users List"                
             13/03/2009 19:22          <[email protected]>           
                                                                        cc 
                                                                           
                Por favor,                                          Asunto 
                responda a             Re: content length of a page        
              "Turbine Users                                               
                   List"                                                   
             <[email protected]                                             
                 che.org>                                                  
                                                                           
                                                                           





I would look first at some of the old examples of extending the RawScreen
for sending binary data. This does not solve your problem of a finding the
content length of a Turbine/velocity generated page however.

You may need some intermediate step to generate the page then calculate
it's length before you can then set the content length in the response
object.

If you search the archives for things related to RawScreen or sending
binary data, you may get some help there.

You would need to make use of the ByteArrayOutputStream to in essence
capture your screen before you send it to the http response.

You can then update RunData as such:

{
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
                        baos = someMethodBuildsMyScreen();

  data.getResponse().setContentLength(baos.size());
  javax.servlet.ServletOutputStream out = response.getOutputStream();
  baos.writeTo(out);
}


I'm not really sure if there is a way to get the content length directly.

Maybe you can clarify the problem if this was no help :P

--
Jeffery Painter


>
> Hello,
>
> I'd like to be able to return the content length of a turbine generated
> page (actually it's jetspeed 1), so that the browser can render better.
> Is this possible somehow? Is there already an existing function for this?
> If not, any tip on at which point this could be included (I guess just
> before returning the request stream, when all velocity has been
rendered).
>
> Cheers, Bo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to