cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Howard <coc...@leverageweb.com>
Subject Re: Possible to POST using a HTML Generator?
Date Sat, 25 Oct 2003 03:44:30 GMT
Nick Smith wrote:

> 
> Thanks for your answers on this everyone!
> 
>>> Sounds like bottom line is - it can't be done at present.  (unless he 
>>> doesn't really need POST but can substitute GET).
>>
>>
>> Correcting myself: of course it can be done.  It can't be done by 
>> configuring the current set of components available.  A new component, 
>> or additional capability added to an existing component is needed.
> 
> 
> Well, the need is still there, and its sufficient that I'm prepared to 
> get my hands dirty with a bespoke component. Any pointers as to were I 
> should start? I'm guessing I need to write a new generator, but 
> HTTPGenerator doesn't seem to have access to the guts of the url 
> request... any pointers in a general direction would be much appreciated!

OK, hold the phone.  I looked into the 
org.apache.excalibur.source.impl.URLSource which is used for http:// 
sources and it _does_ have support for POST but I don't understand it!

/**
      * Initialize a new object from a <code>URL</code>.
      * @param parameters This is optional
      */
     public void init(URL url, Map parameters) throws IOException
     {
         String systemId = url.toExternalForm();
         setSystemId(systemId);
         setScheme(SourceUtil.getScheme(systemId));

         m_url = url;
         m_isPost = false;

         if (null != parameters)
         {
             m_parameters = (SourceParameters) 
parameters.get(SourceResolver.URI_PARAMETERS);
             final String method = (String) 
parameters.get(SourceResolver.METHOD);

             if ("POST".equalsIgnoreCase(method))
                 m_isPost = true;
         }

...


Ok, so it looks like that has support for POST.  But I don't think the 
HTML Generator takes advantage of it.  How does one get the Map of 
paramenters to contain the value of SourceResolver(METHOD) for instance.
They are not the nested configs of the <map:generate...> call I don't think.

Geoff

Geoff


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


Mime
View raw message