cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <Andre.Juf...@oulu.fi>
Subject Re: How to return a JDom document from a action?
Date Thu, 02 Feb 2006 09:48:43 GMT
Tino Breddin wrote:
> Hi,
> 
> i tried your way:
> 
> Request request = ObjectModelHelper.getRequest(objectModel);
>        Session session = request.getSession(true);
>        session.setAttribute("testparamsession",doc);
> 
> Then:
> ${session.getAttribute('testparamsession')}

It should be something like

${cocoon.session.getAttribute("testparamsession")}

assuming that you doc in the action contains a proper (J)DOM document 
and the session was properly created.


> 
> But i got the same result like before.
> 
> Thanks,
> Tino
> 
> Andre Juffer schrieb:
> 
>> Tino Breddin wrote:
>>
>>> Hi,
>>>
>>> i'm trying to return a JDom document, a xml snippet, from a action, 
>>> and then get access to it in a jx file.
>>> Well, but what i get is:
>>>
>>>
>>>            [Document:  No DOCTYPE declaration, Root is [Element: 
>>> <testrootnode/>]]
>>>
>>> What i expect is:
>>>
>>>          <testrootnode>
>>>                <name>somename</name>
>>>          </testrootnode>
>>>
>>> My approach looks like this:
>>>
>>> (sitemap)
>>>            <map:match pattern="test">
>>>                <map:act type="get-test">
>>>                    <map:generate type="jx"
>>>                        src="show-test.jx" />
>>>                    <map:serialize type="xml" />
>>>                </map:act>
>>>            </map:match>
>>>
>>> (show-test.jx)
>>> <jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
>>>    <content>
>>>        ${request.getAttribute('testparamrequest')}     </content>
>>> </jx:template>
>>>
>>>
>>> Has anyone experience with that?
>>
>>
>> You could put your JDOM document in the session object and retrieve in 
>> show-test.jx with
>>
>> ${session.getAttribute('testparamrequest')}
>>
>>>
>>> Thanks,
>>> Tino
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
The Biocenter and            | Fax: +358-8-553-1141
     the Dep. of Biochemistry | Email: Andre.Juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/

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


Mime
View raw message