Juozas Baliuka wrote:
Methods can be generated too:

    <bcel:method name="methodName" returns="int"   >
      <bcel:arg type="int" name="arg1"/>
      <bcel:body language="javascript">
          <!-- Script to evaluate  --->
             super.methodName(arg1) + arg1*arg1
      </bcel:body>
    </bcel:method>

It can implement or override methods this way, but  It can be possible to
implement without BCEL,
I am not sure, but it seems jython can extend/implement JAVA
classes/interfaces and return
 jython classes as JAVA types.
Hmm,

I actually have played around a bit with some custom tags, what they do is pickup the "Script" body out of a JellyTag and execute it when a specific method is called.

ie.

<setup>
....
</setup>


gets called by my class:

private Script setup;

public void setup() throws Exception{
if(setup != null && context != null && output != null){
setup.run(context, output);
}

}

I suspect this wouldn't work if the class were created in Jelly then used later on elsewhere outside of Jelly because the instance of the Script would be gone. However, it works rather well as long as an object instance on of the class is created and used within the "scope" of the Jelly Interpreter.

SideNote: I'm not sure how kosher it is to use "parts"/"instances" of a tag outside of the scope of the tag, I know this isn't recommended for JSP Taglibraries by the Jakarta Taglibraries crew. Primarily because they don't promise that the instance of the tag will be there (or that it may have be reused when the tag is encountered again in the JSP). I think they recommend using a "Data Model" or "Bean" behind the tag to support the functionality that my be required outside the scope of the tag.

As Tomcat now supports Tag Caching and reuse for JSP's is there any thought how this would effect issues as well in Jelly?

-Mark



--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to