You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by leona s <lr...@realtime.net> on 2003/02/22 05:37:06 UTC

POSTing form data to a servlet

Hi All,

I hope someone here can help me with a Cocoon problem.

I have an application that uses Xindice for its data store. I also
have a servlet that can get data from Xindice, such as:

 <map:generate
src="http://localhost:8080/kong/servlet/MyServlet?MyAction=GetXMLResource&am
p;MyCollection=mycoll&amp;MyResource=mystuff"/>

This work just fine for getting whatever is in "mystuff".  Now I want to do
updates
to Xindice using information posted from an HTML form.

For example, I have:

<form method="POST" action="add_detail>
  <input type="text" name="someinput"/>
  <input type="submit" name="submit" value="submit"/>
  <input type="hidden" name="MyAction" value="XUpdate"/>
  <!-- other values sent to the sitemap -->
</form>

I have a pipeline in my sitemap that maps to this form, but I don't know how
I can get the information from the form POST to the servlet. I have tried
things like:
    <map:match pattern="add_detail">
      <map:act type="request">
        <map:parameter name="parameters" value="true"/>
        <map:generate src=http://localhost:8080/kong/servlet/MyServlet/>
        <map:serialize/>
      </map:act>
    </map:match>

but it doesn't pass the parameters to the servlet. I don't want to append
the
individual parameters to the end of the servlet call (i.e. GET). In other
words,
is there an action or generator that acts like a POST to whatever servlet
you
give it, and uses the current sitemap parameters (those that have been sent
by
the form)? This seems to be a common enough problem that such a component
would already exist, but I have done extensive searches and haven't found
one.

I am using WXPPro/C 2.0.4/Tomcat 4.1.18/JDK 1.4.

Thanks very much.
Leona Slepetis




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


Re: POSTing form data to a servlet

Posted by Murad Jura <mu...@asbt.uz>.
I may use the CInclude transformer. It can send "POST" and other HTTP 
methods to the server. See cocoon docs (esp. "Including External XML").

Murad Juraev.

leona s wrote:
> Hi All,
> 
> I hope someone here can help me with a Cocoon problem.
> 
> I have an application that uses Xindice for its data store. I also
> have a servlet that can get data from Xindice, such as:
> 
>  <map:generate
> src="http://localhost:8080/kong/servlet/MyServlet?MyAction=GetXMLResource&am
> p;MyCollection=mycoll&amp;MyResource=mystuff"/>
> 
> This work just fine for getting whatever is in "mystuff".  Now I want to do
> updates
> to Xindice using information posted from an HTML form.
> 
> For example, I have:
> 
> <form method="POST" action="add_detail>
>   <input type="text" name="someinput"/>
>   <input type="submit" name="submit" value="submit"/>
>   <input type="hidden" name="MyAction" value="XUpdate"/>
>   <!-- other values sent to the sitemap -->
> </form>
> 
> I have a pipeline in my sitemap that maps to this form, but I don't know how
> I can get the information from the form POST to the servlet. I have tried
> things like:
>     <map:match pattern="add_detail">
>       <map:act type="request">
>         <map:parameter name="parameters" value="true"/>
>         <map:generate src=http://localhost:8080/kong/servlet/MyServlet/>
>         <map:serialize/>
>       </map:act>
>     </map:match>
> 
> but it doesn't pass the parameters to the servlet. I don't want to append
> the
> individual parameters to the end of the servlet call (i.e. GET). In other
> words,
> is there an action or generator that acts like a POST to whatever servlet
> you
> give it, and uses the current sitemap parameters (those that have been sent
> by
> the form)? This seems to be a common enough problem that such a component
> would already exist, but I have done extensive searches and haven't found
> one.
> 
> I am using WXPPro/C 2.0.4/Tomcat 4.1.18/JDK 1.4.
> 
> Thanks very much.
> Leona Slepetis
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 




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