Hi,

i have a web application that generates a data bean. The content of
this bean should be displayed with the help of cocoon 2.0.4. I tried
to convert the bean into xml with castor and then base64 encode the
xml string, as i wanted to pass the string as parameter in the cocoon
http call. In cocoon i defined an xsp-page - which is the first xsp
code that i wrote - that should decode the String again. The result
however is a NullPointerException. Does anybody have a hint what i am
doing wrong here.


servlet 
        //populate bean
        MyBean tBean = new MyBean();
        tBean.set(...)
        //convert bean to xml
        Writer tWriter = new StringWriter();
        Marshaller.marshal(tBean, tWriter);
        //base64 encode the result
        String tOutput = Base64.encode(tWriter.toString());

cocoon call
        http://localhost/cocoon/report.xml?data=<tOutput>

pipeline
        <map:match pattern="report.xml">
          <map:generate type="serverpages" src="report.xsp"/>
          <map:serialize type="xml"/>
        </map:match>

severpage
        <xsp:logic>
          String value = Base64.decode(request.getParameter("data"));
        </xsp:logic>
        <report>
          <data><xsp-request:get-parameter name="data"/></data>
          <value><xsp:expr>value</xsp:expr></value>
        </report>


Maybe my communication mechanism is too complicated. Now the output is
passed to a small jsp, that automatically starts the call to cocoon.
I'd like to post the xml string directly to cocoon and receive the
data with the stream generator, but i have no idea how this can be
achieved from a servlet.


Thanks for your help

Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to