You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jochen Kuhnle <li...@kuhnle.net> on 2005/04/09 01:43:50 UTC

Creating Java objects in JX templates with JEXL?

Hi, is it possible to create Java objects in JX templates using JEXL? 
Something like <jx:set var="src" value="${new Object()}"/>?

Regards,
Jochen

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


Re: Creating Java objects in JX templates with JEXL?

Posted by Leszek Gawron <lg...@mobilebox.pl>.
Jochen Kuhnle wrote:
> Leszek Gawron <lg...@apache.org> wrote on 09.04.2005 08:06:53:
> 
> 
>>Mark Lundquist wrote:
>>
>><jx:set var="map" value="${java.util.HashMap()}"/>
>><jx:set var="myBean" value="${Packages.com.mycompany.MyBean(1,2)}"/>
> 
> 
> Hmm, the JXTemplateGenerator from Cocoon 2.1.8-dev evaluates these 
> expressions as null. Is this a bug, or are the expressions wrong?
Are you using jxtg from flow or as a separate generator? It won't 
probably work for a separate generator. It will if you switch to 2.2-dev

-- 
Leszek Gawron                                      lgawron@mobilebox.pl
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

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


Re: Creating Java objects in JX templates with JEXL?

Posted by Jochen Kuhnle <li...@kuhnle.net>.
Leszek Gawron <lg...@apache.org> wrote on 09.04.2005 08:06:53:

> Mark Lundquist wrote:
> > 
> <jx:set var="map" value="${java.util.HashMap()}"/>
> <jx:set var="myBean" value="${Packages.com.mycompany.MyBean(1,2)}"/>

Hmm, the JXTemplateGenerator from Cocoon 2.1.8-dev evaluates these 
expressions as null. Is this a bug, or are the expressions wrong?

Regards,
Jochen


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


Re: Creating Java objects in JX templates with JEXL?

Posted by Leszek Gawron <lg...@apache.org>.
Mark Lundquist wrote:
> 
> On Apr 8, 2005, at 4:43 PM, Jochen Kuhnle wrote:
> 
>> Hi, is it possible to create Java objects in JX templates using JEXL?
>> Something like <jx:set var="src" value="${new Object()}"/>?
> 
> 
> 1) I think so
> 
> 2) It sounds like a bad idea
<jx:set var="map" value="${java.util.HashMap()}"/>
<jx:set var="myBean" value="${Packages.com.mycompany.MyBean(1,2)}"/>

-- 
Leszek Gawron                                                 MobileBox
lgawron@apache.org                              http://www.mobilebox.pl

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


Re: Creating Java objects in JX templates with JEXL?

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Apr 8, 2005, at 4:43 PM, Jochen Kuhnle wrote:

> Hi, is it possible to create Java objects in JX templates using JEXL?
> Something like <jx:set var="src" value="${new Object()}"/>?

1) I think so

2) It sounds like a bad idea

HTH,
—ml—


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


Re: Creating Java objects in JX templates with JEXL?

Posted by Thorsten Scherler <th...@apache.org>.
On Sat, 2005-04-09 at 01:43 +0200, Jochen Kuhnle wrote:
> Hi, is it possible to create Java objects in JX templates using JEXL? 
> Something like <jx:set var="src" value="${new Object()}"/>?
> 

<jx:set var="orderDate" value="${java.util.Date()}"/>

is working fine.

HTH
salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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