cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <agalla...@agsoftware.dnsalias.com>
Subject RE: [xsp-session-fw] NPE when use getxml with empty tag
Date Thu, 18 Dec 2003 12:22:18 GMT
Laurent Trillaud dijo:
> Yes, I know but in this case, I need a string.
> In fact the logicsheet is not safe enough because the java generated is
> ((DocumentFragment) blahblah).getFirstChild().getNodeValue();
> Laurent

I have the following problem with the solution you suggested. I use the
getxml inside a <xsp:expr>:

<xsp:expr>Integer.parseInt(<xsp-session-fw:getxml context="authentication"
path="/authentication/data/loc_id" as="string"/>)</xsp:expr>

This is translated to:

(Integer.parseInt(
        	node = ((DocumentFragment)(XSPSessionFwHelper.getXML(this.manager,
                String.valueOf("authentication"),
                String.valueOf("/authentication/data/loc_id")))).getFirstChild();
        	node != null ? node.getNodeValue() : ""))

In this sample this is a bad compiled code, because we cannot use inside a
function Integer.parseInt 2 instructions:

(DocumentFragment)(XSPSessionFwHelper.getXML(this.manager,
                String.valueOf("authentication"),
                String.valueOf("/authentication/data/loc_id")))).getFirstChild();

and

node != null ? node.getNodeValue() : ""

What we can do?

Best Regards,

Antonio Gallardo

>
>> -----Message d'origine-----
>> De : Antonio Gallardo [mailto:agallardo@agsoftware.dnsalias.com]
>> Envoyé : mardi 16 décembre 2003 14:06
>> À : users@cocoon.apache.org
>> Objet : Re: [xsp-session-fw] NPE when use getxml with empty tag
>>
>> Laurent Trillaud dijo:
>> > Hi
>> >>From the portal engine, for example, when I use <xsp-session-fw:getxml
>> > as="string" context="authentication"
>> path="/authentication/data/title"/>
>> I
>> > got an NPE if this tag is empty.
>> > If I put something on it in the sunrise-user.xml from the portal
>> sample,
>> > it's working fine.
>> > Any idea?
>>
>> Try:
>>
>> as="object"
>>
>> More info @ http://wiki.cocoondev.org/Wiki.jsp?page=XspSessionFw
>>
>> Best Regards,
>>
>> Antonio Gallardo
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>


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


Mime
View raw message