You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by James Burton <st...@yahoo.com> on 2002/02/27 14:59:50 UTC

Serializers sending Headers?

Hi all,

I'm coding a custom serializer now, and I am wondering
if I am allowed to send an arbitrary HTTP header from
the serializer code?  In particular I'd like to send a
"Location: xxxx" header, but I may want to send
others.  I think I can accomplish this with these
lines:

 Response response = (Response)
    objectModel.get(Constants.RESPONSE_OBJECT);
 response.setHeader("Some-Header", "value");

But even if that works, is it "legal"?

Thanks from Prague,
James Burton


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Serializers sending Headers?

Posted by giacomo <gi...@apache.org>.
On Wed, 27 Feb 2002, James Burton wrote:

> Hi all,
>
> I'm coding a custom serializer now, and I am wondering
> if I am allowed to send an arbitrary HTTP header from
> the serializer code?  In particular I'd like to send a
> "Location: xxxx" header, but I may want to send
> others.  I think I can accomplish this with these
> lines:
>
>  Response response = (Response)
>     objectModel.get(Constants.RESPONSE_OBJECT);
>  response.setHeader("Some-Header", "value");

Where do you get the objectModel from? A Serializer is supposed to
do one thing only: serialize SAX events to an OutputStream.

Giacomo

>
> But even if that works, is it "legal"?
>
> Thanks from Prague,
> James Burton
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion!
> http://greetings.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Serializers sending Headers?

Posted by giacomo <gi...@apache.org>.
On Wed, 27 Feb 2002, James Burton wrote:

> But... but... I see in the ResourceReader that it
> sends headers, for example:

We are talking about Serializers not Readers. You have to look at a
Reader as a compination of a Generator (which has access to the
environmental objects) and a Serializer.

>  response.setHeader("Accept-Ranges", "bytes");
>
> If a Reader can send a header, why not a Serializer?

You'll find the answer in the quoted mail below from Koen

Giacomo

>
> Thanks,
> James
>
> --- Koen Pellegrims <ko...@pandora.be>
> wrote:
> > Cocoon in general and serializers specifically are
> > not limited to the
> > HTTP-protocol...
> > What will you do if your serializer is used when
> > Cocoon is called from the
> > command-line?
> > A serializer must serialize only content, and not
> > mess with the transport
> > layer...
> >
> > K.
> >
> > On Wed, 27 Feb 2002, James Burton wrote:
> >
> > > Hi all,
> > >
> > > I'm coding a custom serializer now, and I am
> > wondering
> > > if I am allowed to send an arbitrary HTTP header
> > from
> > > the serializer code?  In particular I'd like to
> > send a
> > > "Location: xxxx" header, but I may want to send
> > > others.  I think I can accomplish this with these
> > > lines:
> > >
> > >  Response response = (Response)
> > >     objectModel.get(Constants.RESPONSE_OBJECT);
> > >  response.setHeader("Some-Header", "value");
> > >
> > > But even if that works, is it "legal"?
> > >
> > > Thanks from Prague,
> > > James Burton
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Greetings - Send FREE e-cards for every
> > occasion!
> > > http://greetings.yahoo.com
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > cocoon-dev-unsubscribe@xml.apache.org
> > > For additional commands, email:
> > cocoon-dev-help@xml.apache.org
> > >
> > >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email:
> > cocoon-dev-help@xml.apache.org
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion!
> http://greetings.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Serializers sending Headers?

Posted by Torsten Curdt <tc...@dff.st>.
On Wed, 27 Feb 2002, James Burton wrote:

> But... but... I see in the ResourceReader that it
> sends headers, for example:
>
>  response.setHeader("Accept-Ranges", "bytes");
>
> If a Reader can send a header, why not a Serializer?

Hm.. good point!

But IIRC there is an action to set arbitrary headers...
--
Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Serializers sending Headers?

Posted by James Burton <st...@yahoo.com>.
But... but... I see in the ResourceReader that it
sends headers, for example:

 response.setHeader("Accept-Ranges", "bytes");

If a Reader can send a header, why not a Serializer?

Thanks,
James

--- Koen Pellegrims <ko...@pandora.be>
wrote:
> Cocoon in general and serializers specifically are
> not limited to the
> HTTP-protocol...
> What will you do if your serializer is used when
> Cocoon is called from the
> command-line?
> A serializer must serialize only content, and not
> mess with the transport
> layer...
> 
> K.
> 
> On Wed, 27 Feb 2002, James Burton wrote:
> 
> > Hi all,
> >
> > I'm coding a custom serializer now, and I am
> wondering
> > if I am allowed to send an arbitrary HTTP header
> from
> > the serializer code?  In particular I'd like to
> send a
> > "Location: xxxx" header, but I may want to send
> > others.  I think I can accomplish this with these
> > lines:
> >
> >  Response response = (Response)
> >     objectModel.get(Constants.RESPONSE_OBJECT);
> >  response.setHeader("Some-Header", "value");
> >
> > But even if that works, is it "legal"?
> >
> > Thanks from Prague,
> > James Burton
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Greetings - Send FREE e-cards for every
> occasion!
> > http://greetings.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email:
> cocoon-dev-help@xml.apache.org
> >
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email:
> cocoon-dev-help@xml.apache.org
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Serializers sending Headers?

Posted by Koen Pellegrims <ko...@pandora.be>.
Cocoon in general and serializers specifically are not limited to the
HTTP-protocol...
What will you do if your serializer is used when Cocoon is called from the
command-line?
A serializer must serialize only content, and not mess with the transport
layer...

K.

On Wed, 27 Feb 2002, James Burton wrote:

> Hi all,
>
> I'm coding a custom serializer now, and I am wondering
> if I am allowed to send an arbitrary HTTP header from
> the serializer code?  In particular I'd like to send a
> "Location: xxxx" header, but I may want to send
> others.  I think I can accomplish this with these
> lines:
>
>  Response response = (Response)
>     objectModel.get(Constants.RESPONSE_OBJECT);
>  response.setHeader("Some-Header", "value");
>
> But even if that works, is it "legal"?
>
> Thanks from Prague,
> James Burton
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every occasion!
> http://greetings.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org