Andre Juffer wrote:
> 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.
Before we go any farther down this path, I don't think getting access to
the object is the problem; it seemed pretty clear from his original
example that he was already successfully getting access to the object,
but it is just not being serialized in the way he expects.
I haven't tried it to verify, but I believe to have a DOM document get
serialized into the XML stream you need to use <jx:out
value="${request.getAttribute('testparamrequest')}" /> since the jx:out
element treats certain objects like DOM documents specially whereas the
${} expression just calls toString() or something like that.
>>
>> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]