----- Original Message -----
From: "Martin Cooper" <[EMAIL PROTECTED]>
> I'm trying to invoke a Jelly script from within an app (actually, a
> servlet), and am running into problems. The error I am getting is:
>
> Aug 27, 2002 11:07:53 PM org.apache.commons.jelly.impl.Embedded execute
> SEVERE: This tag does not understand the attribute 'j' File: null At tag
> <j:jelly>: line: 3 column: 0
> This tag does not understand the attribute 'j' File: null At tag
<j:jelly>:
> line: 3 column: 0
This error sounds like the namespace xmlns:j="jelly:core" is being
interpreted as j="jelly:core" which is wierd. This could be a SAX parser
issue. Which SAX parser is on your classpath? Could it be a wierd, or old
SAX parser I wonder?
> My Jelly script at this point is trivial, and is based on stuff I saw in
the
> various samples. It looks like this:
>
> <?xml version="1.0"?>
>
> <j:jelly xmlns:j="jelly:core">
> <j:set var="p1-plus-p2" value="${p1}${p2}" />
> </j:jelly>
>
> My Java code is almost the same as the example in the Javadoc for
Embedded.
> It looks like this:
>
> Embedded embedded = new Embedded();
> embedded.setOutputStream(os);
> embedded.setVariable("p1", "succ");
> embedded.setVariable("p2", "ess");
> embedded.setScript(is);
> boolean bStatus = embedded.execute();
> if (bStatus) {
> String result =
> (String)embedded.getContext().getVariable("p1-plus-p2");
> // Do stuff with result
> }
>
> Any ideas what I'm doing wrong? Also, I'm assuming that Embedded is the
> right class to be using in this situation. Is that correct?
If you like. I tend to just use JellyContext directly...
JellyContext context = new JellyContext();
context.setVaraible("a", whatever);
...
XMLOutput output = new XMLOutput( myOutputStream );
context.runScript( "foo.jelly", output );
James
-------
http://radio.weblogs.com/0112098/
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>