You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Pe...@mediacenter.nl on 2005/04/08 10:48:47 UTC

Betr.: Re: Passing request headers




Hi Volkm@r

Thanks for your answer. I think we have a little misunsderstanding. I'm not
very experienced in the web world, so perhaps I use the wrong terminology,
in which case, please straighten me out. Or, if I completely missed your
point, straighten me out as well :-)

There are many ways to pass request parameters to HtmlGenerator, but what I
want to do is change the outgoing request header. In Java, I would do it
like this:
      URL url = new URL( "http://old-server/legacy.html" );
      URLConnection conn = url.openConnection();
      conn.setRequestProperty( "accept-language", "nl" );
After that you can open a stream and let Tidy do its thing. This works: if
I give it "nl" I get 08-04-2005 and if I give it "en-us" I get 04/08/2005
if that date happens to be in the html.
I don't see any way to tell HtmlGenerator to do that. Perhaps Upayavira is
right and I need to subclass HtmlGenerator. The Cocoon source is very new
to me so this will take some time.



news <ne...@sea.gmane.org> wrote on 07-04-2005 10:28:17:

> Peter.Urbanus@mediacenter.nl wrote:
> > [...]
> > Thanks, Volkm@r.
> > Do you mean that you can have HtmlGenerator operate on a request
attribute?
> > If i understand that correctly, that would mean you can read your html
from
> > a POST request. That wouldn't help, because I want that html from the
old
> > server. You know, send it a http request like
> >
> > GET http://old-server/legacy.html HTTP/1.1
> > accept-language: nl, en-us
> > etc.
> >
> > I browsed the source oif HtmlTransformer, and it also has a parameter
> > copy-parameters, but that wouldn't help me either, it just copies the
> > query-string at the end of the src attribute.
> >
> > Or am I totally missing something?
> >
> > Peter
>
> Hi Peter,
> What I understand from that documentation mentioned is that you can use
> "generate" with additional parameters.
>
> So if you have a request like
>
>    http://yourServer/yourPath?Source=http://foo.bar.tld
>
> which will be matched by your pipeline, you could pass additional
> parameters.
>
> ---------------------------------
> <map:match pattern="yourPath">
>    <map:generate type="html" src="{request-param:Source}">
>      <map:parameter name="..." value="..."/>
>    </map:generate>
>    ...
> </map:match>
> ---------------------------------
>
> Sorry, if I'm wrong. Haven't tested that case.
> --
> Volkm@r
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


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