cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Rohrmeier <>
Subject Passing xml data from a servlet to cocoon
Date Fri, 22 Aug 2003 08:29:43 GMT

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.

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

cocoon call

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

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

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


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message