cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: [C1] Posting parameters to a servlet
Date Tue, 12 Jun 2001 13:43:10 GMT


Xavier MACHENAUD a écrit :
> 
> Using C1, I can call a servlet passing parameters with an HTTP GET using
> the following code :
> 
>   <util:include-uri>
>     <util:href>
>       <xsp:expr>
>         "http://<server>/<servlet-uri>?" +
>         "techno=" + request.getParameter("techno") + "&amp;" +
>         "volt="   + request.getParameter("volt")   + "&amp;" +
>         "arch="   + request.getParameter("arch")   + "&amp;" +
>         "words="  + request.getParameter("words")  + "&amp;" +
>         "bits="   + request.getParameter("bits")   + "&amp;"
>       </xsp:expr>
>     </util:href>
>   </util:include-uri>
> 
> I can then transform the returned XML data to present it to the user.
> 
> But how can I do the same thing but passing parameters with an HTTP
> POST?
> I need this to be able to send a file to a servlet.
> 
> Thanks.
> 
> Xavier
> 
The answer is unfortunately simple : you can't POST using
<util:include-uri> !
You'll have to write code that does the POST using a
java.net.HttpURLConnection and parse its result for inclusion into the
document.
-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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


Mime
View raw message