commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zed A. Shaw" <>
Subject [jelly] Many Problems, Solutions?
Date Mon, 02 Sep 2002 10:58:20 GMT

I've been working with Jelly to see if it will fit the bill for a project
I'm contemplating.  I have been running into some problems though that I
thought someone could help me with.  This e-mail is kinda long, but I'm
basically trying to learn Jelly to the point that I can start writing some
tags I'll need and start using for an application.  If someone could answer
my many questions, I'll be well on my way to cracking this wonderful nut.

Here's the running list so far:

Project Problems:

1.  Example jelly scripts used in unit tests not included in source distro

2.  Source X-Reference generation replaces Jelly source with Unit test
sources.   So, if you go the Jelly site and try to look at the source x-ref
for the JellySwing tags, you only find the source for the unit tests.

3.  Tag documentation is organized in a "flat file" format.  How hard is to
get this organized in a frames format similar to JavaDoc?  I'd be willing to
attempt this if someone is willing to shoot me help when I get stuck.

4.  Is is possible to put examples into the tag library classes?  Maybe,
creating the tag library documentation from the tag library's java docs
would be a great way to do this.

XML Processing Problems:

1.  Can't seem to figure out how the jelly:jsl style tag works.  I tried
creating an XML document with jelly:xml parse, and then a stylesheet with
jelly:jsl stylesheet, and then applying those together with jelly:jsl style,
but it barfs on the doc that jelly:xml parse produces.  It complains that
the doc is not a valid XML document.  The examples in the Junit don't help

2.  It seems rather random whether an jelly:xml, jelly:core, or jelly:jsl
will accept a XPath, XML Document, or both.  Maybe I'm confused on this, but
let's take the jelly:jsl stylesheet vs. jelly:jsl style tags.
With a <x:parse var="doc" xml="test.xml" /> this code works:
    <stylesheet select="$doc">...</stylesheet>
But not this:
    <stylesheet var="thesheet">...</stylesheet>
    <style stylesheet="$thesheet" select="$doc" />

Shouldn't all "select" attributes in all tags take the same types (XPath or
Document Node) and work with them the same, unless otherwise specified?  Or,
am I not understanding something about how this works?

3.  What's the difference between $somevar and ${somevar}.  I'm assuming
that ${} says to do Jexl processing and $ just references a variable.  My
problem arises when I need to just reference a variable in a text block
like:  <echo>Iwantastringwith$somevarinit</echo>.  Only
<echo>Iwantastringwith${somevar}init</echo> would escape the var I want, but
I can't figure out the magic incantation to get Jexl to give me the text of
that var.

4.  When I set a variable using jelly:xml set, what Jexl expressions will
access attributes?  For example, <x:set var="something" select="@anattr" />
and then how do I get a ${something} value back so I can include it in the

5.  Can I use DVSL in the stock Jelly scripts just like in Maven?  I tried
this, but I can't figure out what the magic incantations are to get it to
work.  I figured I'd ask before I go down a blind path.  If not, what do I
add to get DVSL processing similar to that available in Maven?

JellySwing Problems:

1.  Looks like LayoutManagers were forgotten, or I just can't figure out how
to set them.  If I do this:
    <borderLayout var="bl" />
    <panel layout="$bl">...</panel>

Then I get a "panel does not have a write attribute for layout".  I'm
guessing this is because the setLayout method takes a LayoutManager class,
and the mechanism that sets attributes isn't smart enough to see that
BorderLayout is a subclass of LayoutManager.

Also, once a layout is specified, is there a convenient way to indicate its

I think a simple way to solve this is similar to how SplitPanel is handled
in ComponentTag.  You would make a special case for LayoutManagers being
added to a component, and initialize the component with that layout manager.
Another option would to be to create a new Taglib class similar to ActionTag
and WindowListenerTag called LayoutManagerTag, which would handle the layout
managers that are possible.  Then, possibly adding a convenience attribute
to the ComponentTag for constraint="NORTH" or such.  This constraint
attribute would search to the closest parent LayoutManagerTag it found, get
the list of constraints available, and then set it's component's constraints
as requested.  This would make using layouts work like this:

        <button text="North Button" constraint="NORTH" />
        <button text="South Button" constraint="SOUTH" />

Well, that's it for now.  Let me know the answers at your leisure.

Zed A. Shaw

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

View raw message