commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [jelly] Create hierarchical jexl expression.
Date Sun, 04 Jan 2004 00:15:05 GMT

I want to create hierachical expression to access at every level.
An example would says it better :
<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core" xmlns:s="jelly:myPackage.jelly.SamaTagLibrary">
	<s:declaration name="declaration"> 
		<s:domain name="referential">
			<s:entity name="personne">
                            <s:attribute name="name"/>
                            <s:attribute name="forname"/>
		<s:domain name="ldap">
			<s:entity name="person"/>
                            <s:attribute name="surname"/>
                            <s:attribute name="givenname"/>

After the <declaration> tag I would access to some data
with expression like :
 but also 
${ldap.person}	to designate the set of attribute under 

I have first try this

DomainTag.dotTag ==>
			HashMap myHashMap = new HashMap();
			JellyContext myContext = this.getContext();
			myContext.setVariable(getName(), myHashMap);

and EntityTag.doTag ==>
			HashMap domainMap = (HashMap)( this.getContext
().getVariable(((SamaDomainTag)domainTag).getName()) );
			if ( domainMap != null )
				if (domainMap.containsKey(getName()) == true )
					throw new JellyTagException
("Entity "+getName()+" already exists !"); 

but it's no really pretty.

If I put for each of them
this.getContext().setVariable(getName(), this);

do the Expression evalutation scan from parent to child contexts
to evaluate ${domain.entity.attribute} ?

Can somebody explain "softly" :) the context hierachie between nested elements ?

Thanks a lot :)

PS : setExport(true) implies NullPointerException, and with the first try it 
works better without.
There's something I don't understood with JellyContext ?

Marc DeXeT (at home)

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

View raw message