You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by wrobell <wr...@posexperts.com.pl> on 2001/04/10 12:29:33 UTC

passing param using embedded cocoon 1

I am embedding cocoon framework within my application.
How can I pass parameters to logic of the xml file?

I tried following code:

--------
EngineWrapper engine=...
OutputStream out=...
engine.handle(out, new File("file.xml?Date=2001-01-01"));
--------


With this part of xml file I am getting NullPointerException:

--------
  <xsp:logic>String date=request.getParameter(&quot;Date&quot;);
  <td>Date (length: <xsp:expr>date.length()</xsp:expr>)</td>
  </xsp:logic>
--------

Any ideas?


Thanks in advance

  wrobell <wr...@posexperts.com.pl>

---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


VoiceXML - saving audio files

Posted by Tiberiu Dondera <ti...@hotmail.com>.
I'm trying to create a VoiceXML/Cocoon site. And I'm stuck on saving user
audio input on the server...
I open a file and then I write the input parameter to the file (as you will
see in the code). However, even if the Cocoon process has ended (Cocoon
returns the answer), the file is still open (i'm under windows 2000, and I
can't erase the file - which has a 0 size - until I stop Tomcat).
Any idea why this happens?

The code:

VoiceXML:
        <record name="recording">
            <prompt>
             Say something.
            </prompt>
        </record>
        <filled>
          <submit next="test.xml" method="post"
enctype="multipart/form-data" namelist="recording"/>
        </filled>
       </record>

(input stops when user presses a key on the phone keypad). Then Cocoon takes
over - the post of the data is well done.

Cocoon file:

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<page>
  <xsp:logic>
    FileOutputStream fis=new FileOutputStream("input.au");
    fis.write((request.getParameter("recording")).getBytes());
    fis.close();
  </xsp:logic>
</page>
</xsp:page>

I'm using IBM's Voice Server Kit...

Thanks for any help.

Tibi DONDERA


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>